Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uisearch api #1166

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions resources/lib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Loading