Force consume when continuous shuffle is enabled

This commit is contained in:
Théo Marchal 2022-12-08 14:33:58 +01:00
parent c785965041
commit e76cf3cd2a

View File

@ -8,6 +8,7 @@ using System.Windows.Input;
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using System.Diagnostics; using System.Diagnostics;
using System.Data; using System.Data;
using MpcNET.Commands.Playback;
namespace unison namespace unison
{ {
@ -136,6 +137,10 @@ namespace unison
if (_shuffleWin.GetContinuous()) if (_shuffleWin.GetContinuous())
{ {
// force consume: there's no other way to be sure
// that we don't get to the end of the queue with nothing to play
_mpd.SendCommand(new ConsumeCommand(true));
_mpd.CanPrevNext = false; _mpd.CanPrevNext = false;
await _shuffleWin.HandleContinuous(); await _shuffleWin.HandleContinuous();
_mpd.CanPrevNext = true; _mpd.CanPrevNext = true;