mirror of
https://github.com/zoriya/Opus.git
synced 2025-12-06 06:26:15 +00:00
Solved queue reorder bugs.
This commit is contained in:
@@ -64,7 +64,8 @@ namespace Opus.Resources.Portable_Class
|
||||
if (alwaysAllowSwap && (target.AdapterPosition + 1 == ((QueueAdapter)adapter).ItemCount || target.AdapterPosition == 0))
|
||||
return false;
|
||||
|
||||
from = source.AdapterPosition;
|
||||
if(from == -1)
|
||||
from = source.AdapterPosition;
|
||||
to = target.AdapterPosition;
|
||||
adapter.ItemMoved(source.AdapterPosition, target.AdapterPosition);
|
||||
return true;
|
||||
|
||||
@@ -375,15 +375,19 @@ namespace Opus.Resources.Portable_Class
|
||||
fromPosition--;
|
||||
toPosition--;
|
||||
|
||||
Console.WriteLine("&From: " + fromPosition + " To: " + toPosition + " CurrentID:" + MusicPlayer.CurrentID());
|
||||
|
||||
if (MusicPlayer.CurrentID() > fromPosition && MusicPlayer.CurrentID() <= toPosition)
|
||||
MusicPlayer.currentID--;
|
||||
|
||||
else if (MusicPlayer.CurrentID() < fromPosition && MusicPlayer.CurrentID() >= toPosition)
|
||||
MusicPlayer.currentID++;
|
||||
|
||||
else if (MusicPlayer.currentID == fromPosition)
|
||||
else if (MusicPlayer.CurrentID() == fromPosition)
|
||||
MusicPlayer.currentID = toPosition;
|
||||
|
||||
Console.WriteLine("&Updated! From: " + fromPosition + " To: " + toPosition + " CurrentID:" + MusicPlayer.CurrentID());
|
||||
|
||||
if (MusicPlayer.UseCastPlayer)
|
||||
{
|
||||
int nextItemID = MusicPlayer.RemotePlayer.MediaQueue.ItemCount > toPosition ? MusicPlayer.RemotePlayer.MediaQueue.ItemIdAtIndex(toPosition + 1) : 0; //0 = InvalidItemID = end of the queue
|
||||
|
||||
Reference in New Issue
Block a user