private string GenerateNewHintForProvider(MediaConfiguration mi) { if (mi.IdCode(Source) > 0) { return(mi.IdCode(Source).ToString()); } return(mi.ShowName); }
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; } }
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; } }
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))); }
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))); }
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)); }
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)); }
private static bool IsInferiorTo([NotNull] MediaConfiguration testShow, [NotNull] MediaConfiguration compareShow) { return(compareShow.ShowName.StartsWith(testShow.ShowName, StringComparison.Ordinal) && testShow.ShowName.Length < compareShow.ShowName.Length); }
private static bool IsInferiorTo(MediaConfiguration testShow, [NotNull] IEnumerable <MediaConfiguration> matchingShows) { return(matchingShows.Any(compareShow => IsInferiorTo(testShow, compareShow))); }
public ActionDownloadImage(MediaConfiguration si, ProcessedEpisode?pe, FileInfo dest, string path) : this(si, pe, dest, path, false) { }