mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-20 01:42:35 +01:00
Reprocessing manual import items unable to detect sample
(cherry picked from commit 27da0413882dc87e1617a5d091ac5111589e61a6) Closes #10463
This commit is contained in:
parent
a692c35b03
commit
9df45199d0
@ -102,8 +102,6 @@ public ManualImportItem ReprocessItem(string path, string downloadId, int movieI
|
||||
var rootFolder = Path.GetDirectoryName(path);
|
||||
var movie = _movieService.GetMovie(movieId);
|
||||
|
||||
var downloadClientItem = GetTrackedDownload(downloadId)?.DownloadItem;
|
||||
|
||||
var languageParse = LanguageParser.ParseLanguages(path);
|
||||
|
||||
if (languageParse.Count <= 1 && languageParse.First() == Language.Unknown && movie != null)
|
||||
@ -112,6 +110,16 @@ public ManualImportItem ReprocessItem(string path, string downloadId, int movieI
|
||||
_logger.Debug("Language couldn't be parsed from release, fallback to movie original language: {0}", movie.MovieMetadata.Value.OriginalLanguage.Name);
|
||||
}
|
||||
|
||||
var downloadClientItem = GetTrackedDownload(downloadId)?.DownloadItem;
|
||||
var finalReleaseGroup = releaseGroup.IsNullOrWhiteSpace()
|
||||
? Parser.Parser.ParseReleaseGroup(path)
|
||||
: releaseGroup;
|
||||
var finalQuality = (quality?.Quality ?? Quality.Unknown) == Quality.Unknown ? QualityParser.ParseQuality(path) : quality;
|
||||
var finalLanguages =
|
||||
languages?.Count <= 1 && (languages?.SingleOrDefault() ?? Language.Unknown) == Language.Unknown
|
||||
? languageParse
|
||||
: languages;
|
||||
|
||||
var localMovie = new LocalMovie();
|
||||
localMovie.Movie = movie;
|
||||
localMovie.FileMovieInfo = Parser.Parser.ParseMoviePath(path);
|
||||
@ -121,13 +129,24 @@ public ManualImportItem ReprocessItem(string path, string downloadId, int movieI
|
||||
localMovie.SceneSource = SceneSource(movie, rootFolder);
|
||||
localMovie.ExistingFile = movie.Path.IsParentPath(path);
|
||||
localMovie.Size = _diskProvider.GetFileSize(path);
|
||||
localMovie.ReleaseGroup = releaseGroup.IsNullOrWhiteSpace() ? Parser.Parser.ParseReleaseGroup(path) : releaseGroup;
|
||||
localMovie.Languages = languages?.Count <= 1 && (languages?.SingleOrDefault() ?? Language.Unknown) == Language.Unknown ? languageParse : languages;
|
||||
localMovie.Quality = (quality?.Quality ?? Quality.Unknown) == Quality.Unknown ? QualityParser.ParseQuality(path) : quality;
|
||||
localMovie.ReleaseGroup = finalReleaseGroup;
|
||||
localMovie.Languages = finalLanguages;
|
||||
localMovie.Quality = finalQuality;
|
||||
localMovie.IndexerFlags = (IndexerFlags)indexerFlags;
|
||||
|
||||
localMovie.CustomFormats = _formatCalculator.ParseCustomFormat(localMovie);
|
||||
localMovie.CustomFormatScore = localMovie.Movie?.QualityProfile?.CalculateCustomFormatScore(localMovie.CustomFormats) ?? 0;
|
||||
|
||||
// Augment movie file so imported files have all additional information an automatic import would
|
||||
localMovie = _aggregationService.Augment(localMovie, downloadClientItem);
|
||||
|
||||
// Reapply the user-chosen values.
|
||||
localMovie.Movie = movie;
|
||||
localMovie.ReleaseGroup = finalReleaseGroup;
|
||||
localMovie.Quality = finalQuality;
|
||||
localMovie.Languages = finalLanguages;
|
||||
localMovie.IndexerFlags = (IndexerFlags)indexerFlags;
|
||||
|
||||
return MapItem(_importDecisionMaker.GetDecision(localMovie, downloadClientItem), rootFolder, downloadId, null);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user