Rewrite play queue logic of SyncPlay group

This commit is contained in:
Ionut Andrei Oanca
2020-10-22 15:49:37 +02:00
parent 0b4c751657
commit 1cabe82b59
2 changed files with 86 additions and 58 deletions

View File

@@ -263,6 +263,7 @@ namespace Emby.Server.Implementations.SyncPlay
if (sessionIsPlayingAnItem)
{
var playlist = session.NowPlayingQueue.Select(item => item.Id).ToArray();
PlayQueue.Reset();
PlayQueue.SetPlaylist(playlist);
PlayQueue.SetPlayingItemById(session.FullNowPlayingItem.Id);
RunTimeTicks = session.FullNowPlayingItem.RunTimeTicks ?? 0;
@@ -515,6 +516,7 @@ namespace Emby.Server.Implementations.SyncPlay
return false;
}
PlayQueue.Reset();
PlayQueue.SetPlaylist(playQueue);
PlayQueue.SetPlayingItemByIndex(playingItemPosition);
var item = _libraryManager.GetItemById(PlayQueue.GetPlayingItemId());