Beispiel #1
0
    public async Task AddListenLaterEpisode(EpisodeInfo episode)
    {
        await Initialize();

        if (!_episodes.Any(s => s.Id == episode.Id))
        {
            _episodes.Add(episode);
            await _localStorage.SetItem(ListenLaterKey, _episodes);

            EpisodesChanged?.Invoke(_episodes);
        }
    }
Beispiel #2
0
    public async Task RemoveListenLaterEpisode(Guid episodeId)
    {
        await Initialize();

        var episode = _episodes.FirstOrDefault(s => s.Id == episodeId);

        if (episode != null)
        {
            _episodes.Remove(episode);
            await _localStorage.SetItem(ListenLaterKey, _episodes);

            EpisodesChanged?.Invoke(_episodes);
        }
    }