Пример #1
0
        private async Task CheckForNewEpisodesAsync()
        {
            foreach (var podcast in podcasts)
            {
                try
                {
                    var newEpisodes = await podcastService.GetNewEpisodesAsync(podcast.Podcast);

                    var episodes = newEpisodes.Select(e => new EpisodeViewModel(e));
                    episodes.ForEach(e =>
                    {
                        podcast.Episodes.Insert(0, e);
                        podcast.Podcast.Episodes.Insert(0, e.Episode);
                    });
                }
                catch (GetPodcastException ex)
                {
                    //would be a nice idea to log this
                }
            }
        }
Пример #2
0
        private async void CheckForNewEpisodesAsync()
        {
            Debug.WriteLine("Checking for epiodes...");
            foreach (var podcast in podcasts)
            {
                Debug.WriteLine($"Checking episodes for {podcast.Podcast.Title}");
                try
                {
                    var newEpisodes = await podcastService.GetNewEpisodesAsync(podcast.Podcast);

                    var episodes = newEpisodes.Select(e => new EpisodeViewModel(e));
                    episodes.ForEach(e =>
                    {
                        podcast.Episodes.Insert(0, e);
                        podcast.Podcast.Episodes.Insert(0, e.Episode);
                    });
                }
                catch (GetPodcastException ex)
                {
                    //would be a nice idea to log this
                }
            }
            Debug.WriteLine("Check for episodes done...");
        }