Example #1
0
        public bool SameAs(EpisodeControl newEpisode)
        {
            if (Title == newEpisode.Title)
            {
                return(true);
            }

            if (PodcastURL == newEpisode.PodcastURL)
            {
                return(true);
            }

            return(false);
        }
Example #2
0
        internal void ScanLocalFilesOnly()
        {
            List <EpisodeControl> episodes = new List <EpisodeControl>();

            string folderLocation = RssFeed;

            try
            {
                string[] files    = Directory.GetFiles(folderLocation, "*.*", SearchOption.AllDirectories);
                string   showName = new DirectoryInfo(folderLocation).Name;
                foreach (string filename in files)
                {
                    //string folderExtra = filename.Replace(folderLocation, "");
                    //string[] folders = folderExtra.Split(new[] { '\\' }, StringSplitOptions.RemoveEmptyEntries);
                    //string groupName = CreateNewGroup

                    string fileNameUpper = filename.ToUpper();
                    string exp           = Path.GetExtension(fileNameUpper);
                    if (exp != ".MP3" && exp != ".MP4")
                    {
                        continue;
                    }

                    string shortFileName = GetLastFolder(filename);

                    EpisodeControl ep = new EpisodeControl();
                    ep.Description   = showName + " : " + shortFileName;
                    ep.Hidden        = false;
                    ep.PodcastURL    = filename;
                    ep.PublishedDate = DateTime.Now;
                    ep.Title         = Path.GetFileNameWithoutExtension(filename);

                    episodes.Add(ep);
                }
            }
            catch
            {
                // safty catch
            }
            UpdateEpisode(episodes);
        }