Fixed: Importing of completed download when not a child of the download client output path

This commit is contained in:
Mark McDowall
2019-01-09 17:51:54 -08:00
committed by ta264
parent 92a0305740
commit 1dfe6eb6ed
2 changed files with 24 additions and 2 deletions

View File

@@ -178,12 +178,18 @@ namespace NzbDrone.Core.MediaFiles.MovieImport
private string GetOriginalFilePath(DownloadClientItem downloadClientItem, LocalMovie localMovie)
{
var path = localMovie.Path;
if (downloadClientItem != null)
{
return downloadClientItem.OutputPath.Directory.ToString().GetRelativePath(localMovie.Path);
var outputDirectory = downloadClientItem.OutputPath.Directory.ToString();
if (outputDirectory.IsParentPath(path))
{
return outputDirectory.GetRelativePath(path);
}
}
var path = localMovie.Path;
var folderMovieInfo = localMovie.FolderMovieInfo;
if (folderMovieInfo != null)