Stop playback if removed file was currently playing file

This commit is contained in:
ScrubN 2023-12-31 02:13:16 -05:00 committed by Krowe Moh
parent f21060105d
commit 749790b1de

View File

@ -283,6 +283,13 @@ public class AudioPlayerViewModel : ViewModel, ISource, IDisposable
if (_audioFiles.Count < 1) return;
Application.Current.Dispatcher.Invoke(() =>
{
var removedPlaying = false;
if (PlayedFile.Id == SelectedAudioFile.Id)
{
removedPlaying = true;
Stop();
}
_audioFiles.RemoveAt(SelectedAudioFile.Id);
for (var i = 0; i < _audioFiles.Count; i++)
{