コード例 #1
0
 private string GenerateNewHintForProvider(MediaConfiguration mi)
 {
     if (mi.IdCode(Source) > 0)
     {
         return(mi.IdCode(Source).ToString());
     }
     return(mi.ShowName);
 }
コード例 #2
0
 private readonly MediaConfiguration show; // if for an entire show, rather than specific episode
 public ActionDateTouchMedia(DirectoryInfo dir, MediaConfiguration si, DateTime date) : base(dir, date)
 {
     show = si;
     if (si is MovieConfiguration m)
     {
         Movie = m;
     }
 }
コード例 #3
0
        public ActionDownloadImage(MediaConfiguration si, ProcessedEpisode?pe, FileInfo dest, string path, bool shrink)
        {
            Episode                 = pe;
            this.si                 = si;
            destination             = dest;
            this.path               = path;
            shrinkLargeMede8ErImage = shrink;

            if (si is MovieConfiguration m)
            {
                Movie = m;
            }
        }
コード例 #4
0
        public static bool BetterShowsMatch(FileInfo matchedFile, MediaConfiguration currentlyMatchedShow,
                                            bool useFullPath, [NotNull] TVDoc doc)
        {
            if (currentlyMatchedShow is ShowConfiguration currentlyMatchedTvShow)
            {
                return(doc.TvLibrary.Shows
                       .Where(item => item.NameMatch(matchedFile, useFullPath))
                       .Where(item => item.TvdbCode != currentlyMatchedTvShow.TvdbCode)//todo - remove TVDB Dependency
                       .Any(testShow => testShow.ShowName.Contains(currentlyMatchedTvShow.ShowName)));
            }

            return(doc.FilmLibrary.Movies
                   .Where(item => item.NameMatch(matchedFile, useFullPath))
                   .Where(item => item.TmdbCode != currentlyMatchedShow.TmdbCode)//todo - remove TMDB Dependency
                   .Any(testShow => testShow.ShowName.Contains(currentlyMatchedShow.ShowName)));
        }
コード例 #5
0
ファイル: FinderHelper.cs プロジェクト: SirSparkles/tvrename
        public static bool BetterShowsMatch(FileInfo matchedFile, MediaConfiguration currentlyMatchedShow,
                                            bool useFullPath, [NotNull] TVDoc doc)
        {
            if (currentlyMatchedShow is ShowConfiguration currentlyMatchedTvShow)
            {
                IEnumerable <ShowConfiguration> showConfigurations = doc.TvLibrary.Shows
                                                                     .Where(item => item.NameMatch(matchedFile, useFullPath))
                                                                     .Where(item => !HaveACommonId(item, currentlyMatchedTvShow));

                return(showConfigurations
                       .Any(testShow => testShow.ShowName.Contains(currentlyMatchedTvShow.ShowName)));
            }

            return(doc.FilmLibrary.Movies
                   .Where(item => item.NameMatch(matchedFile, useFullPath))
                   .Where(item => !HaveACommonId(item, currentlyMatchedShow))
                   .Any(testShow => testShow.ShowName.Contains(currentlyMatchedShow.ShowName)));
        }
コード例 #6
0
ファイル: FinderHelper.cs プロジェクト: SirSparkles/tvrename
 private static bool HaveSameNonZeroId(MediaConfiguration item, MediaConfiguration currentlyMatchedTvShow, TVDoc.ProviderType p)
 {
     return((item.IdCode(p) == currentlyMatchedTvShow.IdCode(p)) &&
            (item.IdCode(p) > 0) &&
            (currentlyMatchedTvShow.IdCode(p) > 0));
 }
コード例 #7
0
ファイル: FinderHelper.cs プロジェクト: SirSparkles/tvrename
 private static bool HaveACommonId(MediaConfiguration item, MediaConfiguration currentlyMatchedTvShow)
 {
     return(HaveSameNonZeroId(item, currentlyMatchedTvShow, TVDoc.ProviderType.TheTVDB) ||
            HaveSameNonZeroId(item, currentlyMatchedTvShow, TVDoc.ProviderType.TMDB) ||
            HaveSameNonZeroId(item, currentlyMatchedTvShow, TVDoc.ProviderType.TVmaze));
 }
コード例 #8
0
ファイル: FinderHelper.cs プロジェクト: SirSparkles/tvrename
 private static bool IsInferiorTo([NotNull] MediaConfiguration testShow, [NotNull] MediaConfiguration compareShow)
 {
     return(compareShow.ShowName.StartsWith(testShow.ShowName, StringComparison.Ordinal) && testShow.ShowName.Length < compareShow.ShowName.Length);
 }
コード例 #9
0
ファイル: FinderHelper.cs プロジェクト: SirSparkles/tvrename
 private static bool IsInferiorTo(MediaConfiguration testShow, [NotNull] IEnumerable <MediaConfiguration> matchingShows)
 {
     return(matchingShows.Any(compareShow => IsInferiorTo(testShow, compareShow)));
 }
コード例 #10
0
 public ActionDownloadImage(MediaConfiguration si, ProcessedEpisode?pe, FileInfo dest, string path) : this(si, pe, dest, path, false)
 {
 }