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

pull/1674/head
Mitchell Cash 7 years ago committed by Leonardo Galli
parent c33d9727a0
commit 3eab8248e6

@ -368,6 +368,11 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
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;
} }

@ -160,7 +160,17 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual
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)

Loading…
Cancel
Save