Revert "search: add podcasts filter tests"

This reverts commit f73f77b387.
This commit is contained in:
sigma67 2023-11-11 17:15:38 +01:00
commit 38b49056da
No known key found for this signature in database
GPG key ID: 1C314227DF0103D0

View file

@ -109,77 +109,77 @@ class PlaylistsMixin:
response = self._send_request(endpoint, body) response = self._send_request(endpoint, body)
results = nav(response, results = nav(response,
SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + ['musicPlaylistShelfRenderer']) SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + ['musicPlaylistShelfRenderer'])
playlist = {} playlist = {'id': results['playlistId']}
# own_playlist = 'musicEditablePlaylistDetailHeaderRenderer' in response['header'] own_playlist = 'musicEditablePlaylistDetailHeaderRenderer' in response['header']
# if not own_playlist: if not own_playlist:
# header = response['header']['musicDetailHeaderRenderer'] header = response['header']['musicDetailHeaderRenderer']
# playlist['privacy'] = 'PUBLIC' playlist['privacy'] = 'PUBLIC'
# else: else:
# header = response['header']['musicEditablePlaylistDetailHeaderRenderer'] header = response['header']['musicEditablePlaylistDetailHeaderRenderer']
# playlist['privacy'] = header['editHeader']['musicPlaylistEditHeaderRenderer'][ playlist['privacy'] = header['editHeader']['musicPlaylistEditHeaderRenderer'][
# 'privacy'] 'privacy']
# header = header['header']['musicDetailHeaderRenderer'] header = header['header']['musicDetailHeaderRenderer']
#
# playlist['title'] = nav(header, TITLE_TEXT) playlist['title'] = nav(header, TITLE_TEXT)
# playlist['thumbnails'] = nav(header, THUMBNAIL_CROPPED) playlist['thumbnails'] = nav(header, THUMBNAIL_CROPPED)
# playlist["description"] = nav(header, DESCRIPTION, True) playlist["description"] = nav(header, DESCRIPTION, True)
# run_count = len(nav(header, SUBTITLE_RUNS)) run_count = len(nav(header, SUBTITLE_RUNS))
# if run_count > 1: if run_count > 1:
# playlist['author'] = { playlist['author'] = {
# 'name': nav(header, SUBTITLE2), 'name': nav(header, SUBTITLE2),
# 'id': nav(header, SUBTITLE_RUNS + [2] + NAVIGATION_BROWSE_ID, True) 'id': nav(header, SUBTITLE_RUNS + [2] + NAVIGATION_BROWSE_ID, True)
# } }
# if run_count == 5: if run_count == 5:
# playlist['year'] = nav(header, SUBTITLE3) playlist['year'] = nav(header, SUBTITLE3)
#
# playlist['views'] = None playlist['views'] = None
# playlist['duration'] = None playlist['duration'] = None
# if 'runs' in header['secondSubtitle']: if 'runs' in header['secondSubtitle']:
# second_subtitle_runs = header['secondSubtitle']['runs'] second_subtitle_runs = header['secondSubtitle']['runs']
# has_views = (len(second_subtitle_runs) > 3) * 2 has_views = (len(second_subtitle_runs) > 3) * 2
# playlist['views'] = None if not has_views else to_int(second_subtitle_runs[0]['text']) playlist['views'] = None if not has_views else to_int(second_subtitle_runs[0]['text'])
# has_duration = (len(second_subtitle_runs) > 1) * 2 has_duration = (len(second_subtitle_runs) > 1) * 2
# playlist['duration'] = None if not has_duration else second_subtitle_runs[ playlist['duration'] = None if not has_duration else second_subtitle_runs[
# has_views + has_duration]['text'] has_views + has_duration]['text']
# song_count = second_subtitle_runs[has_views + 0]['text'].split(" ") song_count = second_subtitle_runs[has_views + 0]['text'].split(" ")
# song_count = to_int(song_count[0]) if len(song_count) > 1 else 0 song_count = to_int(song_count[0]) if len(song_count) > 1 else 0
# else: else:
# song_count = len(results['contents']) song_count = len(results['contents'])
#
# playlist['trackCount'] = song_count playlist['trackCount'] = song_count
#
request_func = lambda additionalParams: self._send_request(endpoint, body, additionalParams request_func = lambda additionalParams: self._send_request(endpoint, body, additionalParams
) )
#
# # suggestions and related are missing e.g. on liked songs # suggestions and related are missing e.g. on liked songs
# section_list = nav(response, SINGLE_COLUMN_TAB + ['sectionListRenderer']) section_list = nav(response, SINGLE_COLUMN_TAB + ['sectionListRenderer'])
# playlist['related'] = [] playlist['related'] = []
# if 'continuations' in section_list: if 'continuations' in section_list:
# additionalParams = get_continuation_params(section_list) additionalParams = get_continuation_params(section_list)
# if own_playlist and (suggestions_limit > 0 or related): if own_playlist and (suggestions_limit > 0 or related):
# parse_func = lambda results: parse_playlist_items(results) parse_func = lambda results: parse_playlist_items(results)
# suggested = request_func(additionalParams) suggested = request_func(additionalParams)
# continuation = nav(suggested, SECTION_LIST_CONTINUATION) continuation = nav(suggested, SECTION_LIST_CONTINUATION)
# additionalParams = get_continuation_params(continuation) additionalParams = get_continuation_params(continuation)
# suggestions_shelf = nav(continuation, CONTENT + MUSIC_SHELF) suggestions_shelf = nav(continuation, CONTENT + MUSIC_SHELF)
# playlist['suggestions'] = get_continuation_contents(suggestions_shelf, parse_func) playlist['suggestions'] = get_continuation_contents(suggestions_shelf, parse_func)
#
# parse_func = lambda results: parse_playlist_items(results) parse_func = lambda results: parse_playlist_items(results)
# playlist['suggestions'].extend( playlist['suggestions'].extend(
# get_continuations(suggestions_shelf, get_continuations(suggestions_shelf,
# 'musicShelfContinuation', 'musicShelfContinuation',
# suggestions_limit - len(playlist['suggestions']), suggestions_limit - len(playlist['suggestions']),
# request_func, request_func,
# parse_func, parse_func,
# reloadable=True)) reloadable=True))
#
# if related: if related:
# response = request_func(additionalParams) response = request_func(additionalParams)
# continuation = nav(response, SECTION_LIST_CONTINUATION, True) continuation = nav(response, SECTION_LIST_CONTINUATION, True)
# if continuation: if continuation:
# parse_func = lambda results: parse_content_list(results, parse_playlist) parse_func = lambda results: parse_content_list(results, parse_playlist)
# playlist['related'] = get_continuation_contents( playlist['related'] = get_continuation_contents(
# nav(continuation, CONTENT + CAROUSEL), parse_func) nav(continuation, CONTENT + CAROUSEL), parse_func)
playlist['tracks'] = [] playlist['tracks'] = []
if 'contents' in results: if 'contents' in results: