aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/SyncPlay/Queue
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2026-09-06 07:34:30 -0400
committerGitHub <noreply@github.com>2026-09-06 07:34:30 -0400
commitedb6cd11da0c3772ff897757a8364b309e6f7e1a (patch)
tree939047416b59c5f69722c0190c098b8b1ee70017 /MediaBrowser.Controller/SyncPlay/Queue
parent63553803b19446ea9b5cb9b335015ab8727a3799 (diff)
parenta0a42c630ef724fa92b61b261eab8132cb3116d7 (diff)
Merge branch 'master' into fix-code-migration
Diffstat (limited to 'MediaBrowser.Controller/SyncPlay/Queue')
-rw-r--r--MediaBrowser.Controller/SyncPlay/Queue/PlayQueueManager.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/MediaBrowser.Controller/SyncPlay/Queue/PlayQueueManager.cs b/MediaBrowser.Controller/SyncPlay/Queue/PlayQueueManager.cs
index 9326864d78..258b92e4d9 100644
--- a/MediaBrowser.Controller/SyncPlay/Queue/PlayQueueManager.cs
+++ b/MediaBrowser.Controller/SyncPlay/Queue/PlayQueueManager.cs
@@ -157,7 +157,10 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
/// </summary>
public void RestoreSortedPlaylist()
{
- if (PlayingItemIndex != NoPlayingItemIndex)
+ // The shuffled playlist is only populated while the shuffle mode is active, so there is
+ // nothing to map back when the playlist is already sorted. Guarding on its contents keeps
+ // a redundant request for the sorted mode from indexing an empty list.
+ if (PlayingItemIndex != NoPlayingItemIndex && _shuffledPlaylist.Count > 0)
{
var playingItem = _shuffledPlaylist[PlayingItemIndex];
PlayingItemIndex = _sortedPlaylist.IndexOf(playingItem);