Skip to content

Commit

Permalink
Fix uisearch api (#1167)
Browse files Browse the repository at this point in the history
  • Loading branch information
mediaminister authored Apr 17, 2024
1 parent 97bd7c4 commit 5b1c9ef
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions resources/lib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1014,27 +1014,30 @@ 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 = []
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

facets.append({
'name': 'entitytype',
'values': ['video-program'],
})
search_dict = {
'queryString': query_string,
'facets': facets,
Expand Down

0 comments on commit 5b1c9ef

Please sign in to comment.