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) }); }
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)); }
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); }
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) }); }
private static (bool identifysuccess, int foundSeason, int foundEpisode, int maxEp) IdentifyFile([NotNull] ShowItemMissing me, [NotNull] FileInfo dce) { int season = me.MissingEpisode.AppropriateSeasonNumber; int epnum = me.MissingEpisode.AppropriateEpNum; bool regularMatch = FinderHelper.FindSeasEp(dce, out int foundSeason, out int foundEpisode, out int maxEp, me.MissingEpisode.Show) && foundSeason == season && foundEpisode == epnum; if (regularMatch) { return(true, foundSeason, foundEpisode, maxEp); } if (me.MissingEpisode.Show.UseSequentialMatch) { if (FinderHelper.MatchesSequentialNumber(dce.RemoveExtension(false), me.MissingEpisode)) { return(true, season, epnum, me.MissingEpisode.EpNum2); } } if (me.MissingEpisode.Show.UseAirDateMatch) { if (FinderHelper.FindSeasEpDateCheck(dce.Name, out foundSeason, out foundEpisode, me.MissingEpisode.Show)) { if (foundEpisode == epnum && foundSeason == season) { return(true, foundSeason, foundEpisode, -1); } } } if (me.MissingEpisode.Show.UseEpNameMatch) { if (FinderHelper.FindSeasEpNameCheck(dce, me.MissingEpisode.Show, out foundSeason, out foundEpisode)) { if (foundEpisode == epnum && foundSeason == season) { return(true, foundSeason, foundEpisode, -1); } } } return(false, 0, 0, 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)); }
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); }
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); }
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); }
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)); }
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)); }