From c78596504104a6b5b1e58eb854336baf6b9fdbd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Marchal?= Date: Wed, 7 Dec 2022 13:47:30 +0100 Subject: [PATCH] Shuffle: fix quick song change deleting the whole queue --- Handlers/MPDHandler.cs | 6 ++++-- Views/Shuffle.xaml.cs | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Handlers/MPDHandler.cs b/Handlers/MPDHandler.cs index fe70ca7..c7739ee 100644 --- a/Handlers/MPDHandler.cs +++ b/Handlers/MPDHandler.cs @@ -436,6 +436,8 @@ namespace unison } _isUpdatingSong = false; + + Trace.WriteLine("Updated song"); } private async void GetAlbumCover(string path, CancellationToken token) @@ -565,13 +567,13 @@ namespace unison public void Prev() { - if (CanPrevNext) + if (CanPrevNext && !_isUpdatingSong) SendCommand(new PreviousCommand()); } public void Next() { - if (CanPrevNext) + if (CanPrevNext && !_isUpdatingSong) SendCommand(new NextCommand()); } diff --git a/Views/Shuffle.xaml.cs b/Views/Shuffle.xaml.cs index a218931..bc97134 100644 --- a/Views/Shuffle.xaml.cs +++ b/Views/Shuffle.xaml.cs @@ -386,8 +386,9 @@ namespace unison return; int PlaylistLength = _mpd.GetStatus().PlaylistLength; - int Num = 10 - PlaylistLength; - if (Num < 1) + int Num = 50 - PlaylistLength; + + if (PlaylistLength > 25) return; await UpdateFilter();