1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 04:22:30 +01:00

Fixed: Error when processing manual import decisions (#1670)

This commit is contained in:
Mitchell Cash 2017-06-13 16:40:51 +10:00 committed by Leonardo Galli
parent c33d9727a0
commit 3eab8248e6
2 changed files with 16 additions and 1 deletions

View File

@ -368,6 +368,11 @@ private ImportDecision GetDecision(string file, Series series, ParsedEpisodeInfo
decision = new ImportDecision(localEpisode, new Rejection("Unexpected error processing file")); decision = new ImportDecision(localEpisode, new Rejection("Unexpected error processing file"));
} }
if (decision == null)
{
_logger.Error("Unable to make a decision on {0}", file);
}
return decision; return decision;
} }

View File

@ -160,7 +160,17 @@ private ManualImportItem ProcessFile(string file, string downloadId, string fold
var importDecisions = _importDecisionMaker.GetImportDecisions(new List<string> { file }, var importDecisions = _importDecisionMaker.GetImportDecisions(new List<string> { file },
movie, null, SceneSource(movie, folder), true); movie, null, SceneSource(movie, folder), true);
return importDecisions.Any() ? MapItem(importDecisions.First(), folder, downloadId) : null; return importDecisions.Any() ? MapItem(importDecisions.First(), folder, downloadId) : new ManualImportItem
{
DownloadId = downloadId,
Path = file,
RelativePath = folder.GetRelativePath(file),
Name = Path.GetFileNameWithoutExtension(file),
Rejections = new List<Rejection>
{
new Rejection("Unable to process file")
}
};
} }
//private ManualImportItem ProcessFile(string file, string downloadId, string folder = null) //private ManualImportItem ProcessFile(string file, string downloadId, string folder = null)