Exemplo n.º 1
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 <= TimeZoneHelper.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)
            });
        }
        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);
        }
Exemplo n.º 3
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));
        }
Exemplo n.º 4
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)
            });
        }
Exemplo n.º 5
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)
            });
        }
Exemplo n.º 6
0
        public override ItemList ProcessEpisode(ProcessedEpisode dbep, FileInfo filo, bool forceRefresh)
        {
            if (!TVSettings.Instance.Mede8erXML)
            {
                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 ActionMede8erXML(nfo, dbep));
            }

            return(theActionList);
        }
Exemplo n.º 7
0
        public override ItemList?ProcessEpisode(ProcessedEpisode episode, FileInfo file, bool forceRefresh)
        {
            if (!TVSettings.Instance.wdLiveTvMeta)
            {
                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 ActionWdtvMeta(nfo, episode));
            }

            return(theActionList);
        }
Exemplo n.º 8
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");

                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 ActionWdtvMeta(tvshowxml, si));
                }
                return(theActionList);
            }
            return(base.ProcessShow(si, forceRefresh));
        }
Exemplo n.º 9
0
        public override ItemList ProcessShow(ShowItem si, bool forceRefresh)
        {
            // for each tv show, optionally write a tvshow.nfo file
            if (TVSettings.Instance.NFOShows)
            {
                ItemList theActionList = new ItemList();
                FileInfo tvshownfo     = FileHelper.FileInFolder(si.AutoAddFolderBase, "tvshow.nfo");

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

                bool alreadyOnTheList = DoneNfo.Contains(tvshownfo.FullName);

                if ((forceRefresh || needUpdate) && !alreadyOnTheList)
                {
                    theActionList.Add(new ActionNfo(tvshownfo, si));
                    DoneNfo.Add(tvshownfo.FullName);
                }
                return(theActionList);
            }
            return(base.ProcessShow(si, forceRefresh));
        }