private void OnFileEndReached() { Logger.LogInformation($"{nameof(OnFileEndReached)}: End reached for file = {_currentlyPlayedFile?.Path}"); SetCurrentlyPlayingInfo(null, false); IsPaused = false; if (_currentlyPlayedFile != null) { var playlist = PlayLists.FirstOrDefault(pl => pl.Id == _currentlyPlayedFile.PlayListId); playlist?.UpdatePlayedTime(); } if (_currentlyPlayedFile?.Loop == true) { Logger.LogInformation($"{nameof(OnFileEndReached)}: Looping file = {_currentlyPlayedFile?.Path}"); _currentlyPlayedFile.PlayedPercentage = 0; _currentlyPlayedFile.PlayCommand.Execute(); return; } if (_settingsService.PlayNextFileAutomatically) { Logger.LogInformation($"{nameof(OnFileEndReached)}: Play next file is enabled. Playing the next file..."); GoTo(true, true); } else { Logger.LogInformation($"{nameof(OnFileEndReached)}: Play next file is disabled. Next file won't be played, playback will stop now"); StopPlayBackCommand.Execute(); } }
public Task StopPlayBackFromMediaWebSocket() { return(StopPlayBackCommand.ExecuteAsync()); }