Skip to content
Open
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
26 changes: 17 additions & 9 deletions plugin/Plugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -366,20 +366,24 @@ sub myPlaylistHandler {

delete $params->{count};

# need to passthrough the personal account items
my $account = {
_cache_ttl => 60,
# mine=true is for playlists.list only. dont put it in the per-item
# passthrough or playlistItems.list will get it later and load the
# wrong playlist.
my $token = $cache->get('yt:access_token');
my $itemPassthrough = {
_noKey => 1,
mine => 'true',
access_token => $cache->get('yt:access_token'),
access_token => $token,
};

Plugins::YouTube::API->searchDirect('playlists', sub {
$cb->( _renderList($_[0], 'title', $account) );
$cb->( _renderList($_[0], 'title', $itemPassthrough) );
}, {
%$account,
_index => $args->{index},
_quantity => $args->{quantity},
_cache_ttl => 60,
_noKey => 1,
mine => 'true',
access_token => $token,
_index => $args->{index},
_quantity => $args->{quantity},
});
}

Expand All @@ -390,6 +394,10 @@ sub playlistHandler {
$params->{_quantity} = $args->{quantity};
$params->{_cache_ttl} = $prefs->get('cache_ttl');

# extra paranoia. mine belongs to playlists.list, never to playlistItems.list.
# if it slips in here YT returns the wrong playlist.
delete $params->{mine};

Plugins::YouTube::API->searchDirect('playlistItems', sub {
$cb->( _renderList($_[0], $prefs->get('playlist_sort')) );
}, $params);
Expand Down