Made repository methods asynchronous. Simplified playlist repository. Use playlist manager in the app, and left playlist repository to only be used by the playlist manager.
This commit is contained in:
@@ -211,21 +211,21 @@ public partial class PlaybackBarViewModel : ViewModelBase, IDisposable
|
||||
|
||||
_timer = new(TimeSpan.FromMilliseconds(100), DispatcherPriority.Default, TickTock);
|
||||
|
||||
Task.Run(() => PlayDemoSong(playlistRepository));
|
||||
//Task.Run(() => PlayDemoSong(playlistRepository));
|
||||
}
|
||||
|
||||
private async Task PlayDemoSong(IPlaylistRepository playlistRepository)
|
||||
{
|
||||
if (playlistRepository.Get().Count == 0)
|
||||
{
|
||||
playlistRepository.AddPlaylist();
|
||||
}
|
||||
//private async Task PlayDemoSong(IPlaylistManager playlistManager)
|
||||
//{
|
||||
// if (playlistRepository.Get().Count == 0)
|
||||
// {
|
||||
// playlistRepository.AddPlaylist();
|
||||
// }
|
||||
|
||||
Playlist playlist = playlistRepository.Get().First();
|
||||
// Playlist playlist = playlistRepository.Get().First();
|
||||
|
||||
if (playlist.Songs.Count > 0)
|
||||
await _audioPlayer.LoadAsync(playlist.Songs[0], PlaybackMode.LoadOnly);
|
||||
}
|
||||
// if (playlist.Songs.Count > 0)
|
||||
// await _audioPlayer.LoadAsync(playlist.Songs[0], PlaybackMode.LoadOnly);
|
||||
//}
|
||||
|
||||
private void OnAudioPlayerPlayingSongChanged(object? sender, EventArgs e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user