Example #1
0
        public static EpisodeList <PodCastEpisode> FromSyndicationItems(IEnumerable <SyndicationItem> syndicationItems)
        {
            var episodeList = new EpisodeList <PodCastEpisode>();

            foreach (SyndicationItem item in syndicationItems)
            {
                episodeList.Add(PodCastEpisode.FromSyndicationItem(item));
            }
            return(episodeList);
        }
Example #2
0
        public static PodCast FromSyndicationFeed(SyndicationFeed feed, string url)
        {
            var episodes  = new PodCastEpisodeList <PodCastEpisode>();
            var feedTitle = feed.Title.Text;
            //Alla RSS-flöden lagrar inte URL i länksamlingen,
            //vi lade till URL som parameter i metoden istället.
            //var feedURL = feed.Links.SingleOrDefault((p) => p.MediaType == "application/rss+xml").Uri.ToString();
            var feedURL     = url;
            var lastUpdated = feed.LastUpdatedTime;

            foreach (SyndicationItem item in feed.Items)
            {
                episodes.Add(PodCastEpisode.FromSyndicationItem(item));
            }
            return(new PodCast(feedURL, feedTitle, episodes, lastUpdated));
        }