mirror of
https://github.com/anxdpanic/plugin.video.youtube.git
synced 2025-12-15 15:10:34 -08:00
Properly identify custom History playlist in add to playlist dialog
This commit is contained in:
parent
929c070efd
commit
5d95588761
1 changed files with 22 additions and 4 deletions
|
|
@ -216,6 +216,14 @@ def _process_select_playlist(provider, context):
|
|||
else:
|
||||
watch_later_id = context.get_access_manager().get_watch_later_id()
|
||||
|
||||
# add the 'History' playlist
|
||||
if playlists and 'watchHistory' in playlists:
|
||||
watch_history_id = playlists['watchHistory'] or 'HL'
|
||||
else:
|
||||
watch_history_id = context.get_access_manager().get_watch_history_id()
|
||||
|
||||
account_playlists = {watch_later_id, watch_history_id}
|
||||
|
||||
thumb_size = context.get_settings().get_thumbnail_size()
|
||||
default_thumb = context.create_resource_path('media', 'playlist.png')
|
||||
|
||||
|
|
@ -248,14 +256,24 @@ def _process_select_playlist(provider, context):
|
|||
context.create_resource_path('media', 'watch_later.png')
|
||||
))
|
||||
|
||||
# add the 'History' playlist
|
||||
if watch_history_id:
|
||||
items.append((
|
||||
ui.bold(context.localize('history')), '',
|
||||
watch_history_id,
|
||||
context.create_resource_path('media', 'history.png')
|
||||
))
|
||||
|
||||
for playlist in playlists:
|
||||
playlist_id = playlist.get('id')
|
||||
if playlist_id in account_playlists:
|
||||
continue
|
||||
snippet = playlist.get('snippet', {})
|
||||
title = snippet.get('title', '')
|
||||
description = snippet.get('description', '')
|
||||
playlist_id = playlist.get('id', '')
|
||||
title = snippet.get('title')
|
||||
if title and playlist_id:
|
||||
items.append((
|
||||
title, description,
|
||||
title,
|
||||
snippet.get('description', ''),
|
||||
playlist_id,
|
||||
get_thumbnail(
|
||||
thumb_size, snippet.get('thumbnails'), default_thumb
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue