Skip to content

Commit

Permalink
[VideosList] add trackIds data
Browse files Browse the repository at this point in the history
Fix add/remove to my list context menu on search by language
  • Loading branch information
CastagnaIT committed Dec 8, 2023
1 parent c8f6f42 commit 7412b0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def req_videos_list_sorted(self, context_name, context_id=None, perpetual_range_
[base_path[:-1] + [['id', 'name', 'requestId', 'trackIds']]])

path_response = self.nfsession.perpetual_path_request(paths, [response_type, ['videos']], perpetual_range_start)
return VideosList(path_response)
return VideosList(path_response, [context_name, context_id])

@cache_utils.cache_output(cache_utils.CACHE_SUPPLEMENTAL, identify_append_from_kwarg_name='supplemental_type',
ignore_self_class=True)
Expand Down
6 changes: 5 additions & 1 deletion resources/lib/utils/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,18 @@ def get(self, key, default=None):

class VideosList:
"""A video's list"""
def __init__(self, path_response):
def __init__(self, path_response, list_info_path):
# LOG.debug('VideosList data: {}', path_response)
self.perpetual_range_selector = path_response.get('_perpetual_range_selector')
self.data = path_response
self.videos = OrderedDict(self.data.get('videos', {}))
self.artitem = list(self.videos.values())[0] if self.videos else None
self.contained_titles = _get_titles(self.videos)

track_ids = common.get_path_safe(list_info_path, path_response, False, {}).get('trackIds')
if track_ids:
self.component_summary = {'trackIds': track_ids.get('value', {})}

def __getitem__(self, key):
return _check_sentinel(self.data[key])

Expand Down

0 comments on commit 7412b0a

Please sign in to comment.