コード例 #1
0
        public override ItemList ProcessEpisode(ProcessedEpisode dbep, FileInfo filo, bool forceRefresh)
        {
            if (!TVSettings.Instance.EpJPGs)
            {
                return(null);
            }

            ItemList theActionList = new ItemList();

            string ban = dbep.Filename;

            if (string.IsNullOrEmpty(ban))
            {
                return(null);
            }

            string basefn = filo.RemoveExtension();

            FileInfo imgjpg = FileHelper.FileInFolder(filo.Directory, basefn + DEFAULT_EXTENSION);

            if (forceRefresh || !imgjpg.Exists)
            {
                theActionList.Add(new ActionDownloadImage(dbep.Show, dbep, imgjpg, ban, TVSettings.Instance.ShrinkLargeMede8erImages));
            }

            return(theActionList);
        }
コード例 #2
0
        public override ItemList?ProcessMovie(MovieConfiguration si, FileInfo filo, bool forceRefresh)
        {
            //We only want to do something if the fanart option is enabled. If the KODI option is enabled then let it do the work.
            if (TVSettings.Instance.FanArtJpg && !TVSettings.Instance.KODIImages)
            {
                ItemList theActionList = new ItemList();
                foreach (string location in si.Locations)
                {
                    FileInfo fi = FileHelper.FileInFolder(location, DEFAULT_FILE_NAME);

                    bool doesntExist = !fi.Exists;
                    if ((forceRefresh || doesntExist) && !DoneFanartJpg.Contains(fi.FullName))
                    {
                        string bannerPath = si.CachedMovie?.PosterUrl;

                        if (!string.IsNullOrEmpty(bannerPath))
                        {
                            theActionList.Add(new ActionDownloadImage(si, null, fi, bannerPath, false));
                        }

                        DoneFanartJpg.Add(fi.FullName);
                    }
                }

                return(theActionList);
            }

            return(base.ProcessMovie(si, filo, forceRefresh));
        }
コード例 #3
0
        public override ItemList ProcessMovie(MovieConfiguration mc, FileInfo file, bool forceRefresh)
        {
            if (!TVSettings.Instance.FolderJpg)
            {
                return(new ItemList());
            }

            FileInfo fi = FileHelper.FileInFolder(file.Directory, DEFAULT_FILE_NAME);
            bool     fileDoesntExist = !doneFolderJpg.Contains(fi.FullName) && !fi.Exists;

            if (!forceRefresh && !fileDoesntExist)
            {
                return(new ItemList());
            }

            CachedMovieInfo?cachedMovie = mc.CachedMovie;

            if (cachedMovie is null)
            {
                return(new ItemList());
            }

            ItemList theActionList = new ItemList();

            //default to poster when we want season posters for the season specific folders
            string downloadPath = cachedMovie.PosterUrl;

            if (!string.IsNullOrEmpty(downloadPath))
            {
                theActionList.Add(new ActionDownloadImage(mc, null, fi, downloadPath));
            }

            doneFolderJpg.Add(fi.FullName);
            return(theActionList);
        }
コード例 #4
0
        public override ItemList?ProcessEpisode(ProcessedEpisode episode, FileInfo file, bool forceRefresh)
        {
            if (!TVSettings.Instance.NFOEpisodes)
            {
                return(null);
            }

            FileInfo nfo = FileHelper.FileInFolder(file.Directory, file.RemoveExtension() + ".nfo");

            if (nfo.Exists && System.Math.Abs(episode.SrvLastUpdated - TimeZoneHelper.Epoch(nfo.LastWriteTime)) < 1 && !forceRefresh)
            {
                return(null);
            }

            //If we do not already have plans to put the file into place
            if (DoneNfo.Contains(nfo.FullName))
            {
                return(null);
            }

            DoneNfo.Add(nfo.FullName);
            return(new ItemList {
                new ActionNfoEpisode(nfo, episode)
            });
        }
コード例 #5
0
        public override ItemList?ProcessEpisode(ProcessedEpisode episode, FileInfo file, bool forceRefresh)
        {
            if (!TVSettings.Instance.pyTivoMeta)
            {
                return(null);
            }

            ItemList theActionList = new ItemList();
            string   fn            = file.Name + ".txt";

            string folder = file.DirectoryName;

            if (TVSettings.Instance.pyTivoMetaSubFolder)
            {
                folder += "\\.meta";
            }

            FileInfo meta = FileHelper.FileInFolder(folder, fn);

            if (!meta.Exists || episode.SrvLastUpdated > TimeZoneHelper.Epoch(meta.LastWriteTime))
            {
                theActionList.Add(new ActionPyTivoMeta(meta, episode));
            }

            return(theActionList);
        }
コード例 #6
0
        public override ItemList ProcessEpisode(ProcessedEpisode dbep, FileInfo filo, bool forceRefresh)
        {
            if (!TVSettings.Instance.NFOEpisodes)
            {
                return(null);
            }

            string   fn  = filo.RemoveExtension() + ".nfo";
            FileInfo nfo = FileHelper.FileInFolder(filo.Directory, fn);

            if (nfo.Exists && (dbep.SrvLastUpdated <= TimeZone.Epoch(nfo.LastWriteTime)) && !forceRefresh)
            {
                return(new ItemList());
            }

            //If we do not already have plans to put the file into place
            if (DoneNfo.Contains(nfo.FullName))
            {
                return(new ItemList());
            }

            DoneNfo.Add(nfo.FullName);
            return(new ItemList {
                new ActionNfo(nfo, dbep)
            });
        }
コード例 #7
0
        public override ItemList ProcessSeason(ShowItem si, string folder, int snum, bool forceRefresh)
        {
            if (!TVSettings.Instance.FolderJpg)
            {
                return(null);
            }

            // season folders JPGs
            ItemList theActionList = new ItemList();
            FileInfo fi            = FileHelper.FileInFolder(folder, DEFAULT_FILE_NAME);

            if (!doneFolderJpg.Contains(fi.FullName) && (!fi.Exists || forceRefresh))
            // some folders may come up multiple times
            {
                string bannerPath;

                if (TVSettings.Instance.SeasonSpecificFolderJPG())
                {
                    //We are getting a Series Level image
                    bannerPath = si.TheSeries().GetSeasonBannerPath(snum);
                }
                else
                {
                    //We are getting a Show Level image
                    bannerPath = si.TheSeries().GetImage(TVSettings.Instance.ItemForFolderJpg());
                }
                if (!string.IsNullOrEmpty(bannerPath))
                {
                    theActionList.Add(new ActionDownloadImage(si, null, fi, bannerPath,
                                                              TVSettings.Instance.ShrinkLargeMede8erImages));
                }
                doneFolderJpg.Add(fi.FullName);
            }
            return(theActionList);
        }
コード例 #8
0
        public override ItemList ProcessShow(ShowItem si, bool forceRefresh)
        {
            if (TVSettings.Instance.Mede8erXML)
            {
                ItemList theActionList = new ItemList();

                FileInfo tvshowxml = FileHelper.FileInFolder(si.AutoAddFolderBase, "series.xml");

                SeriesInfo seriesInfo = si.TheSeries();
                bool       needUpdate = !tvshowxml.Exists ||
                                        seriesInfo is null ||
                                        seriesInfo.SrvLastUpdated > TimeZoneHelper.Epoch(tvshowxml.LastWriteTime);

                if ((forceRefresh || needUpdate) && !doneFiles.Contains(tvshowxml.FullName))
                {
                    doneFiles.Add(tvshowxml.FullName);
                    theActionList.Add(new ActionMede8erXML(tvshowxml, si));
                }

                //Updates requested by [email protected] on 18/4/2013
                FileInfo viewxml = FileHelper.FileInFolder(si.AutoAddFolderBase, "View.xml");
                if (!viewxml.Exists && !doneFiles.Contains(viewxml.FullName))
                {
                    doneFiles.Add(viewxml.FullName);
                    theActionList.Add(new ActionMede8erViewXML(viewxml, si));
                }

                return(theActionList);
            }

            return(base.ProcessShow(si, forceRefresh));
        }
コード例 #9
0
        public override ItemList ProcessShow(ShowItem si, bool forceRefresh)
        {
            if (!TVSettings.Instance.FolderJpg)
            {
                return(null);
            }

            ItemList theActionList   = new ItemList();
            FileInfo fi              = FileHelper.FileInFolder(si.AutoAddFolderBase, DEFAULT_FILE_NAME);
            bool     fileDoesntExist = !doneFolderJpg.Contains(fi.FullName) && !fi.Exists;

            if (forceRefresh || fileDoesntExist)
            {
                string downloadPath;

                if (TVSettings.Instance.SeasonSpecificFolderJPG())
                {
                    //default to poster when we want season posters for the season specific folders;
                    downloadPath = si.TheSeries().GetSeriesPosterPath();
                }
                else
                {
                    downloadPath = si.TheSeries().GetImage(TVSettings.Instance.ItemForFolderJpg());
                }

                if (!string.IsNullOrEmpty(downloadPath))
                {
                    theActionList.Add(new ActionDownloadImage(si, null, fi, downloadPath, false));
                }
                doneFolderJpg.Add(fi.FullName);
            }
            return(theActionList);
        }
コード例 #10
0
        private ActionDownloadImage DoEpisode(ShowItem si, [NotNull] Episode ep, FileInfo filo, string extension, bool forceRefresh)
        {
            string ban = ep.Filename;

            if (string.IsNullOrEmpty(ban))
            {
                return(null);
            }

            string   basefn = filo.RemoveExtension();
            FileInfo imgtbn = FileHelper.FileInFolder(filo.Directory, basefn + extension);

            if (imgtbn.Exists && !forceRefresh)
            {
                return(null);
            }

            if (doneTbn.Contains(imgtbn.FullName))
            {
                return(null);
            }

            doneTbn.Add(imgtbn.FullName);
            return(new ActionDownloadImage(si, ep is ProcessedEpisode episode ? episode  : new ProcessedEpisode(ep, si), imgtbn, ban));
        }
コード例 #11
0
        public override ItemList ProcessShow(ShowItem si, bool forceRefresh)
        {
            if (TVSettings.Instance.Mede8erXML)
            {
                ItemList TheActionList = new ItemList();

                FileInfo tvshowxml = FileHelper.FileInFolder(si.AutoAdd_FolderBase, "series.xml");

                bool needUpdate = !tvshowxml.Exists ||
                                  (si.TheSeries().Srv_LastUpdated > TimeZone.Epoch(tvshowxml.LastWriteTime));

                if (forceRefresh || needUpdate)
                {
                    TheActionList.Add(new ActionMede8erXML(tvshowxml, si));
                }

                //Updates requested by [email protected] on 18/4/2013
                FileInfo viewxml = FileHelper.FileInFolder(si.AutoAdd_FolderBase, "view.xml");
                if (!viewxml.Exists)
                {
                    TheActionList.Add(new ActionMede8erViewXML(viewxml, si));
                }


                return(TheActionList);
            }

            return(base.ProcessShow(si, forceRefresh));
        }
コード例 #12
0
ファイル: DownloadJolderJPG.cs プロジェクト: Rudu-be/tvrename
        public override ItemList ProcessShow(ShowItem si, bool forceRefresh)
        {
            if (TVSettings.Instance.FolderJpg)
            {
                ItemList TheActionList   = new ItemList();
                FileInfo fi              = FileHelper.FileInFolder(si.AutoAdd_FolderBase, defaultFileName);
                bool     fileDoesntExist = !doneFolderJPG.Contains(fi.FullName) && !fi.Exists;

                if (forceRefresh || fileDoesntExist)
                {
                    //default to poster when we want season posters for the season specific folders;
                    string itemToGet = (TVSettings.Instance.SeasonSpecificFolderJPG()) ? "poster" : TVSettings.Instance.ItemForFolderJpg();

                    string bannerPath = bannerPath = si.TheSeries().GetItem(itemToGet);

                    if (!string.IsNullOrEmpty(bannerPath))
                    {
                        TheActionList.Add(new ActionDownload(si, null, fi, bannerPath, false));
                    }
                    doneFolderJPG.Add(fi.FullName);
                }
                return(TheActionList);
            }
            return(null);
        }
コード例 #13
0
        public override ItemList?ProcessMovie(MovieConfiguration mc, FileInfo file, bool forceRefresh)
        {
            if (!TVSettings.Instance.NFOMovies || mc.CachedMovie is null)
            {
                return(null);
            }

            FileInfo nfo = FileHelper.FileInFolder(file.Directory, file.MovieFileNameBase() + ".nfo");

            if ((nfo.Exists && System.Math.Abs(mc.CachedMovie.SrvLastUpdated - TimeZoneHelper.Epoch(nfo.LastWriteTime)) < 1 && !forceRefresh))
            {
                return(null);
            }

            //If we do not already have plans to put the file into place
            if (DoneNfo.Contains(nfo.FullName))
            {
                return(null);
            }

            DoneNfo.Add(nfo.FullName);
            return(new ItemList {
                new ActionNfoMovie(nfo, mc)
            });
        }
コード例 #14
0
        private FileInfo?CheckFile([NotNull] string folder, FileInfo fi, [NotNull] FileInfo actualFile, string newName, ProcessedEpisode ep, IEnumerable <FileInfo> files)
        {
            if (TVSettings.Instance.RetainLanguageSpecificSubtitles)
            {
                (bool isSubtitleFile, string subtitleExtension) = fi.IsLanguageSpecificSubtitle();

                if (isSubtitleFile && actualFile.Name != newName)
                {
                    newName = TVSettings.Instance.FilenameFriendly(
                        TVSettings.Instance.NamingStyle.NameFor(ep, subtitleExtension, folder.Length));
                }
            }

            FileInfo newFile = FileHelper.FileInFolder(folder, newName); // rename updates the filename

            //**** TODO *** Parameterise case insensitive search
            if (!string.Equals(newFile.FullName, actualFile.FullName, StringComparison.CurrentCultureIgnoreCase))
            {
                //Check that the file does not already exist
                //if (FileHelper.FileExistsCaseSensitive(newFile.FullName))
                if (FileHelper.FileExistsCaseSensitive(files, newFile))
                {
                    LOGGER.Warn(
                        $"Identified that {actualFile.FullName} should be renamed to {newName}, but it already exists.");
                }
                else
                {
                    LOGGER.Info($"Identified that {actualFile.FullName} should be renamed to {newName}.");
                    Doc.TheActionList.Add(new ActionCopyMoveRename(ActionCopyMoveRename.Op.rename, fi,
                                                                   newFile, ep, false, null, Doc));

                    //The following section informs the DownloadIdentifers that we already plan to
                    //copy a file in the appropriate place and they do not need to worry about downloading
                    //one for that purpose
                    downloadIdentifiers.NotifyComplete(newFile);

                    if (newFile.IsMovieFile())
                    {
                        return(newFile);
                    }
                }
            }
            else
            {
                if (actualFile.IsMovieFile())
                {
                    //File is correct name
                    LOGGER.Debug($"Identified that {actualFile.FullName} is in the right place. Marking it as 'seen'.");
                    //Record this episode as seen

                    TVSettings.Instance.PreviouslySeenEpisodes.EnsureAdded(ep);
                    if (TVSettings.Instance.IgnorePreviouslySeen)
                    {
                        Doc.SetDirty();
                    }
                }
            }

            return(null);
        }
コード例 #15
0
        public override ItemList ProcessSeason(ShowItem si, string folder, int snum, bool forceRefresh)
        {
            if (TVSettings.Instance.KODIImages)
            {
                ItemList theActionList = new ItemList();
                //If we have KODI New style images being downloaded then we want to check that 3 files exist
                //for the series:
                //http://wiki.xbmc.org/index.php?title=XBMC_v12_(Frodo)_FAQ#Local_images
                //poster
                //banner
                //fanart - we do not have the option in TVDB to get season specific fanart, so we'll leave that

                string filenamePrefix = "";

                if (si.InOneFolder())
                {   // We have multiple seasons in the same folder
                    // We need to do slightly more work to come up with the filenamePrefix

                    filenamePrefix = "season";

                    if (snum == 0)
                    {
                        filenamePrefix += "-specials";
                    }
                    else if (snum < 10)
                    {
                        filenamePrefix += "0" + snum;
                    }
                    else
                    {
                        filenamePrefix += snum;
                    }

                    filenamePrefix += "-";
                }
                FileInfo posterJpg = FileHelper.FileInFolder(folder, filenamePrefix + "poster.jpg");
                if (forceRefresh || !posterJpg.Exists)
                {
                    string path = si.TheSeries()?.GetSeasonBannerPath(snum);
                    if (!string.IsNullOrEmpty(path))
                    {
                        theActionList.Add(new ActionDownloadImage(si, null, posterJpg, path));
                    }
                }

                FileInfo bannerJpg = FileHelper.FileInFolder(folder, filenamePrefix + "banner.jpg");
                if (forceRefresh || !bannerJpg.Exists)
                {
                    string path = si.TheSeries()?.GetSeasonWideBannerPath(snum);
                    if (!string.IsNullOrEmpty(path))
                    {
                        theActionList.Add(new ActionDownloadImage(si, null, bannerJpg, path));
                    }
                }
                return(theActionList);
            }
            return(base.ProcessSeason(si, folder, snum, forceRefresh));
        }
コード例 #16
0
        public override ItemList ProcessShow(ShowItem si, bool forceRefresh)
        {
            //If we have KODI New style images being downloaded then we want to check that 3 files exist
            //for the series:
            //http://wiki.xbmc.org/index.php?title=XBMC_v12_(Frodo)_FAQ#Local_images
            //poster
            //banner
            //fanart

            if (TVSettings.Instance.KODIImages)
            {
                ItemList TheActionList = new ItemList();
                // base folder:
                if (!string.IsNullOrEmpty(si.AutoAdd_FolderBase) && (si.AllFolderLocations(false).Count > 0))
                {
                    FileInfo posterJPG = FileHelper.FileInFolder(si.AutoAdd_FolderBase, "poster.jpg");
                    FileInfo bannerJPG = FileHelper.FileInFolder(si.AutoAdd_FolderBase, "banner.jpg");
                    FileInfo fanartJPG = FileHelper.FileInFolder(si.AutoAdd_FolderBase, "fanart.jpg");

                    if ((forceRefresh || (!posterJPG.Exists)) && (!donePosterJPG.Contains(si.AutoAdd_FolderBase)))
                    {
                        string path = si.TheSeries().GetSeriesPosterPath();
                        if (!string.IsNullOrEmpty(path))
                        {
                            TheActionList.Add(new ActionDownload(si, null, posterJPG, path, false));
                            donePosterJPG.Add(si.AutoAdd_FolderBase);
                        }
                    }

                    if ((forceRefresh || (!bannerJPG.Exists)) && (!doneBannerJPG.Contains(si.AutoAdd_FolderBase)))
                    {
                        string path = si.TheSeries().GetSeriesWideBannerPath();
                        if (!string.IsNullOrEmpty(path))
                        {
                            TheActionList.Add(new ActionDownload(si, null, bannerJPG, path, false));
                            doneBannerJPG.Add(si.AutoAdd_FolderBase);
                        }
                    }

                    if ((forceRefresh || (!fanartJPG.Exists)) && (!doneFanartJPG.Contains(si.AutoAdd_FolderBase)))
                    {
                        string path = si.TheSeries().GetSeriesFanartPath();
                        if (!string.IsNullOrEmpty(path))
                        {
                            TheActionList.Add(new ActionDownload(si, null, fanartJPG, path));
                            doneFanartJPG.Add(si.AutoAdd_FolderBase);
                        }
                    }
                }
                return(TheActionList);
            }

            return(base.ProcessShow(si, forceRefresh));
        }
コード例 #17
0
        public override ItemList?ProcessMovie(MovieConfiguration movie, FileInfo file, bool forceRefresh)
        {
            //If we have KODI New style images being downloaded then we want to check that 3 files exist
            //for the cachedSeries:
            //http://wiki.xbmc.org/index.php?title=XBMC_v12_(Frodo)_FAQ#Local_images
            //poster
            //banner
            //fanart

            if (TVSettings.Instance.KODIImages)
            {
                ItemList theActionList = new ItemList();
                string   baseFileName  = file.MovieFileNameBase();

                FileInfo posterJpg = FileHelper.FileInFolder(file.Directory, baseFileName + "-poster.jpg");
                FileInfo bannerJpg = FileHelper.FileInFolder(file.Directory, baseFileName + "-banner.jpg");
                FileInfo fanartJpg = FileHelper.FileInFolder(file.Directory, baseFileName + "-fanart.jpg");

                if ((forceRefresh || !posterJpg.Exists) && !donePosterJpg.Contains(file.Directory.FullName))
                {
                    string path = movie.CachedMovie?.PosterUrl;
                    if (!string.IsNullOrEmpty(path))
                    {
                        theActionList.Add(new ActionDownloadImage(movie, null, posterJpg, path, false));
                        donePosterJpg.Add(file.Directory.FullName);
                    }
                }

                if ((forceRefresh || !bannerJpg.Exists) && !doneBannerJpg.Contains(file.Directory.FullName))
                {
                    string path = string.Empty; //todo link up movir banner url movie.CachedMovie?.BannerUrl;
                    if (!string.IsNullOrEmpty(path))
                    {
                        theActionList.Add(new ActionDownloadImage(movie, null, bannerJpg, path, false));
                        doneBannerJpg.Add(file.Directory.FullName);
                    }
                }

                if ((forceRefresh || !fanartJpg.Exists) && !doneFanartJpg.Contains(file.Directory.FullName))
                {
                    string path = movie.CachedMovie?.FanartUrl;
                    if (!string.IsNullOrEmpty(path))
                    {
                        theActionList.Add(new ActionDownloadImage(movie, null, fanartJpg, path));
                        doneFanartJpg.Add(file.Directory.FullName);
                    }
                }
                return(theActionList);
            }

            return(base.ProcessMovie(movie, file, forceRefresh));
        }
コード例 #18
0
 public override ItemList ProcessShow(ShowItem si, bool forceRefresh)
 {
     if (TVSettings.Instance.wdLiveTvMeta)
     {
         ItemList theActionList = new ItemList();
         FileInfo tvshowxml     = FileHelper.FileInFolder(si.AutoAddFolderBase, "series.xml");
         bool     needUpdate    = !tvshowxml.Exists ||
                                  (si.TheSeries().SrvLastUpdated > TimeZone.Epoch(tvshowxml.LastWriteTime));
         if ((forceRefresh || needUpdate) && (!doneFiles.Contains(tvshowxml.FullName)))
         {
             doneFiles.Add(tvshowxml.FullName);
             theActionList.Add(new ActionWdtvMeta(tvshowxml, si));
         }
         return(theActionList);
     }
     return(base.ProcessShow(si, forceRefresh));
 }
コード例 #19
0
        public override ItemList ProcessEpisode(ProcessedEpisode dbep, FileInfo filo, bool forceRefresh)
        {
            if (TVSettings.Instance.Mede8erXML)
            {
                ItemList TheActionList = new ItemList();
                string   fn            = filo.RemoveExtension() + ".xml";
                FileInfo nfo           = FileHelper.FileInFolder(filo.Directory, fn);

                if (forceRefresh || !nfo.Exists || (dbep.Srv_LastUpdated > TimeZone.Epoch(nfo.LastWriteTime)))
                {
                    TheActionList.Add(new ActionMede8erXML(nfo, dbep));
                }

                return(TheActionList);
            }
            return(base.ProcessEpisode(dbep, filo, forceRefresh));
        }
コード例 #20
0
        public override ItemList?ProcessEpisode(ProcessedEpisode episode, FileInfo file, bool forceRefresh)
        {
            if (!TVSettings.Instance.Mede8erXML)
            {
                return(null);
            }

            ItemList theActionList = new ItemList();
            string   fn            = file.RemoveExtension() + ".xml";
            FileInfo nfo           = FileHelper.FileInFolder(file.Directory, fn);

            if (forceRefresh || !nfo.Exists || episode.SrvLastUpdated > TimeZoneHelper.Epoch(nfo.LastWriteTime))
            {
                theActionList.Add(new ActionMede8erXML(nfo, episode));
            }

            return(theActionList);
        }
コード例 #21
0
        public override ItemList ProcessEpisode(ProcessedEpisode dbep, FileInfo filo, bool forceRefresh)
        {
            if (!TVSettings.Instance.wdLiveTvMeta)
            {
                return(null);
            }

            ItemList theActionList = new ItemList();
            string   fn            = filo.RemoveExtension() + ".xml";
            FileInfo nfo           = FileHelper.FileInFolder(filo.Directory, fn);

            if (forceRefresh || !nfo.Exists || (dbep.SrvLastUpdated > TimeZoneHelper.Epoch(nfo.LastWriteTime)))
            {
                theActionList.Add(new ActionWdtvMeta(nfo, dbep));
            }

            return(theActionList);
        }
コード例 #22
0
        public override ItemList ProcessSeason(ShowItem si, string folder, int snum, bool forceRefresh)
        {
            if (!TVSettings.Instance.Mede8erXML)
            {
                return(null);
            }
            ItemList theActionList = new ItemList();

            //Updates requested by [email protected] on 18/4/2013
            FileInfo viewxml = FileHelper.FileInFolder(folder, "View.xml");

            if (!viewxml.Exists)
            {
                theActionList.Add(new ActionMede8erViewXML(viewxml, si, snum));
            }

            return(theActionList);
        }
コード例 #23
0
        private ActionDownloadImage DoEpisode(ShowItem si, Episode ep, FileInfo filo, string extension, bool forceRefresh)
        {
            string ban = ep.GetFilename();

            if (!string.IsNullOrEmpty(ban))
            {
                string   basefn = filo.RemoveExtension();
                FileInfo imgtbn = FileHelper.FileInFolder(filo.Directory, basefn + extension);
                if (!imgtbn.Exists || forceRefresh)
                {
                    if (!(this.doneTBN.Contains(imgtbn.FullName)))
                    {
                        this.doneTBN.Add(imgtbn.FullName);

                        return(new ActionDownloadImage(si, (ep is ProcessedEpisode) ? (ProcessedEpisode)ep  : new ProcessedEpisode(ep, si), imgtbn, ban));
                    }
                }
            }
            return(null);
        }
コード例 #24
0
        public override ItemList ProcessSeason(ShowItem si, string folder, int snum, bool forceRefresh)
        {
            if (!TVSettings.Instance.SeriesJpg)
            {
                return(null);
            }

            ItemList theActionList = new ItemList();
            FileInfo fi            = FileHelper.FileInFolder(folder, DEFAULT_FILE_NAME);

            if (forceRefresh || (!doneJpg.Contains(fi.FullName) && !fi.Exists))
            {
                string bannerPath = si.TheSeries().GetSeasonBannerPath(snum);
                if (!string.IsNullOrEmpty(bannerPath))
                {
                    theActionList.Add(new ActionDownloadImage(si, null, fi, bannerPath, TVSettings.Instance.ShrinkLargeMede8erImages));
                }
                doneJpg.Add(fi.FullName);
            }
            return(theActionList);
        }
コード例 #25
0
        public override ItemList ProcessSeason(ShowItem si, string folder, int snum, bool forceRefresh)
        {
            if (TVSettings.Instance.SeriesJpg)
            {
                ItemList TheActionList = new ItemList();
                FileInfo fi            = FileHelper.FileInFolder(folder, defaultFileName);
                if (forceRefresh || (!doneJPG.Contains(fi.FullName) && !fi.Exists))
                {
                    string bannerPath = si.TheSeries().GetSeasonBannerPath(snum);
                    if (!string.IsNullOrEmpty(bannerPath))
                    {
                        TheActionList.Add(new ActionDownload(si, null, fi, bannerPath, TVSettings.Instance.ShrinkLargeMede8erImages));
                    }
                    doneJPG.Add(fi.FullName);
                }
                return(TheActionList);
            }


            return(base.ProcessSeason(si, folder, snum, forceRefresh));
        }
コード例 #26
0
        public override ItemList?ProcessShow(ShowConfiguration si, bool forceRefresh)
        {
            if (TVSettings.Instance.wdLiveTvMeta)
            {
                ItemList theActionList = new ItemList();
                FileInfo tvShowXml     = FileHelper.FileInFolder(si.AutoAddFolderBase, "cachedSeries.xml");

                CachedSeriesInfo cachedSeriesInfo = si.CachedShow;
                bool             needUpdate       = !tvShowXml.Exists ||
                                                    cachedSeriesInfo is null ||
                                                    cachedSeriesInfo.SrvLastUpdated > TimeZoneHelper.Epoch(tvShowXml.LastWriteTime);

                if ((forceRefresh || needUpdate) && !doneFiles.Contains(tvShowXml.FullName))
                {
                    doneFiles.Add(tvShowXml.FullName);
                    theActionList.Add(new ActionWdtvMeta(tvShowXml, si));
                }
                return(theActionList);
            }
            return(base.ProcessShow(si, forceRefresh));
        }
コード例 #27
0
        public override ItemList ProcessEpisode(ProcessedEpisode dbep, FileInfo filo, bool forceRefresh)
        {
            if (TVSettings.Instance.NFOEpisodes)
            {
                ItemList TheActionList = new ItemList();

                string   fn  = filo.RemoveExtension() + ".nfo";
                FileInfo nfo = FileHelper.FileInFolder(filo.Directory, fn);

                if (!nfo.Exists || (dbep.Srv_LastUpdated > TimeZone.Epoch(nfo.LastWriteTime)) || forceRefresh)
                {
                    //If we do not already have plans to put the file into place
                    if (!(DownloadKodiMetaData.doneNFO.Contains(nfo.FullName)))
                    {
                        TheActionList.Add(new ActionNFO(nfo, dbep));
                        doneNFO.Add(nfo.FullName);
                    }
                }
                return(TheActionList);
            }
            return(base.ProcessEpisode(dbep, filo, forceRefresh));
        }
コード例 #28
0
ファイル: DownloadFanartJPG.cs プロジェクト: Rudu-be/tvrename
        public override ItemList ProcessShow(ShowItem si, bool forceRefresh)
        {
            //We only want to do something if the fanart option is enabled. If the XBMC option is enabled then let it do the work.
            if ((TVSettings.Instance.FanArtJpg) && !TVSettings.Instance.XBMCImages)
            {
                ItemList TheActionList = new ItemList();
                FileInfo fi            = FileHelper.FileInFolder(si.AutoAdd_FolderBase, defaultFileName);

                bool doesntExist = !fi.Exists;
                if ((forceRefresh || doesntExist) && (!doneFanartJPG.Contains(fi.FullName)))
                {
                    string bannerPath = si.TheSeries().GetItem("fanart");

                    if (!string.IsNullOrEmpty(bannerPath))
                    {
                        TheActionList.Add(new ActionDownload(si, null, fi, bannerPath, false));
                    }
                    doneFanartJPG.Add(fi.FullName);
                }
                return(TheActionList);
            }
            return(base.ProcessShow(si, forceRefresh));
        }
コード例 #29
0
        public override ItemList ProcessEpisode(ProcessedEpisode dbep, FileInfo filo, bool forceRefresh)
        {
            if (TVSettings.Instance.pyTivoMeta)
            {
                ItemList TheActionList = new ItemList();
                string   fn            = filo.Name;
                fn += ".txt";
                string folder = filo.DirectoryName;
                if (TVSettings.Instance.pyTivoMetaSubFolder)
                {
                    folder += "\\.meta";
                }
                FileInfo meta = FileHelper.FileInFolder(folder, fn);

                if (!meta.Exists || (dbep.Srv_LastUpdated > TimeZone.Epoch(meta.LastWriteTime)))
                {
                    TheActionList.Add(new ActionPyTivoMeta(meta, dbep));
                }

                return(TheActionList);
            }
            return(base.ProcessEpisode(dbep, filo, forceRefresh));
        }
コード例 #30
0
        public override ItemList ProcessEpisode(ProcessedEpisode dbep, FileInfo filo, bool forceRefresh)
        {
            if (TVSettings.Instance.EpJPGs)
            {
                ItemList TheActionList = new ItemList();
                string   ban           = dbep.GetFilename();
                if (!string.IsNullOrEmpty(ban))
                {
                    string basefn = filo.RemoveExtension();

                    FileInfo imgjpg = FileHelper.FileInFolder(filo.Directory, basefn + defaultExtension);

                    if (forceRefresh || !imgjpg.Exists)
                    {
                        TheActionList.Add(new ActionDownloadImage(dbep.SI, dbep, imgjpg, ban, TVSettings.Instance.ShrinkLargeMede8erImages));
                    }
                }

                return(TheActionList);
            }

            return(base.ProcessEpisode(dbep, filo, forceRefresh));
        }