mirror of
https://github.com/zoriya/Opus.git
synced 2025-12-06 06:26:15 +00:00
Allowing users to switch playback before the end of a parse.
This commit is contained in:
@@ -464,6 +464,7 @@ namespace Opus.Api.Services
|
||||
Queue.instance?.Refresh();
|
||||
Player.instance?.RefreshPlayer();
|
||||
currentID = 0;
|
||||
SongParser.Cancel(0);
|
||||
await new SongParser().ParseSong(song, 0, true);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -251,6 +251,15 @@ namespace Opus.Api
|
||||
return song;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Will stop the parsing for a slot of the queue. Use this when the user wants to play something else before the end of a parsing (Want to play something on the same queue slot but not the same song has the one being parsed now).
|
||||
/// </summary>
|
||||
/// <param name="queuePosition"></param>
|
||||
public static void Cancel(int queuePosition)
|
||||
{
|
||||
instances.Where(x => x.queuePosition == queuePosition).FirstOrDefault()?.Cancel();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method will remove playback calls and get requests from the
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user