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); } }
private async void OnPlaylistFinished(CancellationToken cancellationToken) { await sessionDataService.PurgeData(PlaylistDataKey, cancellationToken); }