public async Task CreatePodcastObject(string url, string name, int interval, string category)
        {
            await Task.Run(() =>
            {
                var episodesList  = podcastRepository.reader.GetEpisodes(url);
                int episodeAmount = podcastRepository.reader.GetAmountOfEpisodes(url);

                podcastRepository.Create(new Podcast(url, new Category(category), interval, episodesList.Result, name, episodeAmount));
            });
        }
Ejemplo n.º 2
0
        public async Task <Podcast> AddNewPodcast(string url, string name, string category, int interval)
        {
            Podcast podcast = new Podcast();
            await Task.Run(() =>
            {
                var episodes = GetEpisodesForPodcast(url);
                Podcast p    = new Podcast(url, name, category, interval, episodes);

                podcastRepository.Create(p);
            });

            return(podcast);
        }