From 74c01dce35aa4ab3c58e157ec2ba93cf2a68d72f Mon Sep 17 00:00:00 2001 From: mediaminister <45148099+mediaminister@users.noreply.github.com> Date: Wed, 17 Apr 2024 21:29:20 +0200 Subject: [PATCH] Fix uisearch api (#1166) --- resources/lib/api.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/resources/lib/api.py b/resources/lib/api.py index 135703bb..123c9112 100644 --- a/resources/lib/api.py +++ b/resources/lib/api.py @@ -1014,25 +1014,29 @@ def get_programs(category=None, channel=None, keywords=None, end_cursor=''): from json import dumps page_size = get_setting_int('itemsperpage', default=50) query_string = None + facets = [ + { + 'name': 'entitytype', + 'values': ['video-program'], + }] if category: facet_name = 'genre' # VRT MAX uses 'contenttype' facet name instead of 'genre' for some categories if category in ('docu', 'films', 'series', 'talkshows'): facet_name = 'contenttype' destination = 'categories' - facets = [{ + facets.append({ 'name': facet_name, - 'values': [category] - }] + 'values': [category], + }) elif channel: destination = 'channels' - facets = [{ + facets.append({ 'name': 'brand', 'values': [channel] - }] + }) elif keywords: destination = 'search_query' - facets = None query_string = keywords search_dict = {