Skip to content

Commit

Permalink
Dont ask for playlist order when playing from specific video
Browse files Browse the repository at this point in the history
  • Loading branch information
MoojMidge committed Oct 26, 2024
1 parent 0388d14 commit 2351a4a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions resources/lib/youtube_plugin/youtube/helper/yt_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def _play_playlist(provider, context):
playlist_ids = params.get('playlist_ids')
if not playlist_ids:
playlist_ids = [params.get('playlist_id')]
video_id = params.get('video_id')

resource_manager = provider.get_resource_manager(context)
ui = context.get_ui()
Expand Down Expand Up @@ -223,8 +224,10 @@ def _play_playlist(provider, context):
return False

# select order
order = params.get('order', '')
if not order:
order = params.get('order')
if not order and not video_id:
order = 'ask'
if order == 'ask':
order_list = ('default', 'reverse', 'shuffle')
items = [(context.localize('playlist.play.%s' % order), order)
for order in order_list]
Expand All @@ -250,7 +253,6 @@ def _play_playlist(provider, context):
playlist_player.unshuffle()

# check if we have a video as starting point for the playlist
video_id = params.get('video_id')
playlist_position = None if video_id else 0
# add videos to playlist
for idx, video in enumerate(videos):
Expand Down

0 comments on commit 2351a4a

Please sign in to comment.