public static int UpdateAllPodcasts(ref IOutput output)
        {
            int updateCount = 0;

            GetAllPodcast();

            foreach (var podcast in _podcastsDictionary)
            {
                Podcast p = new Podcast(podcast.Key, podcast.Value, true);

                p.GetPodcastNewlyRelease(ref output, ref updateCount);
            }

            return(updateCount);
        }
        public static void DownloadPodcastAfterDate(DateTime dt, string downloadFileDirectory, bool isSimpleFile, string downloadProgram)
        {
            GetAllPodcast();

            ProgramConfiguration.DownloadFileName = downloadFileDirectory + Path.DirectorySeparatorChar + "PodcastDownload.txt";

            FileStream fs = File.Create(ProgramConfiguration.DownloadFileName);

            foreach (var podcast in _podcastsDictionary)
            {
                Podcast p = new Podcast(podcast.Key, podcast.Value, true);

                p.BuildPodcastDownloadFile(dt, downloadFileDirectory, isSimpleFile, downloadProgram, ref fs);
            }

            fs.Close();
        }
        public static int ListPodcastAllRelease(string name, ref IOutput output)
        {
            GetAllPodcast();
            string url;

            try
            {
                url = _podcastsDictionary[name];
            }
            catch
            {
                output.WriteLine("Error. Input of Name does not contain in the library.");
                return(-1);
            }

            Podcast podcast = new Podcast(name, url);

            podcast.GetPodcastAllReleaseDetail(ref output);

            return(0);
        }
        public static string ShowPodcastDetail(string name)
        {
            GetAllPodcast();
            string url;

            Logger.Log.Info("Get the name's podcast info.");

            try
            {
                url = _podcastsDictionary[name];
            }
            catch
            {
                Logger.Log.Warn("The name is not in the dictionary.");
                return("Error.Input of Name does not contain in the library.");
            }

            Podcast podcast = new Podcast(name, url);

            Logger.Log.Info("Get the podcast detail.");
            return(podcast.GetPodcastDetail());
        }
        private static string GetPodcastName(string url)
        {
            Podcast podcast = new Podcast(url);

            return(podcast.Name);
        }