コード例 #1
0
        protected override async Task OnPlaylistChanged(CancellationToken cancellationToken)
        {
            var playlistData = new PlaylistData(Songs, CurrentSongIndex);

            await sessionDataService.SaveData(PlaylistDataKey, playlistData, cancellationToken);

            await base.OnPlaylistChanged(cancellationToken);
        }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
 public async Task RegisterAdvicePlayback(AdvisedPlaylist advise, CancellationToken cancellationToken)
 {
     Memo = Memo.RegisterPlayback(advise);
     await sessionDataService.SaveData(PlaylistAdviserDataKey, Memo, cancellationToken);
 }