protected override async Task OnPlaylistChanged(CancellationToken cancellationToken) { var playlistData = new PlaylistData(Songs, CurrentSongIndex); await sessionDataService.SaveData(PlaylistDataKey, playlistData, cancellationToken); await base.OnPlaylistChanged(cancellationToken); }
private async Task SaveScrobblesQueue(CancellationToken cancellationToken) { if (scrobblesQueue.Any()) { var scrobbles = scrobblesQueue.ToArray(); await sessionDataService.SaveData(ScrobblesDataKey, scrobbles, cancellationToken); } else { await sessionDataService.PurgeData(ScrobblesDataKey, cancellationToken); } }
public async Task RegisterAdvicePlayback(AdvisedPlaylist advise, CancellationToken cancellationToken) { Memo = Memo.RegisterPlayback(advise); await sessionDataService.SaveData(PlaylistAdviserDataKey, Memo, cancellationToken); }