mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 20:12:41 +02:00
Fixed: Importing completed downloads from NZBGet with post processing script failing
Fixes #2919
This commit is contained in:
parent
1dfe6eb6ed
commit
a9ee3d5bc5
@ -380,5 +380,20 @@ public void should_use_folder_info_original_title_to_find_relative_path_when_fil
|
||||
|
||||
Mocker.GetMock<IMediaFileService>().Verify(v => v.Add(It.Is<MovieFile>(c => c.OriginalFilePath == $"subfolder\\{name}.mkv".AsOsAgnostic())));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_use_folder_info_original_title_to_find_relative_path_when_download_client_item_has_an_empty_output_path()
|
||||
{
|
||||
var name = "Transformers.2007.720p.BluRay.x264-Radarr";
|
||||
var outputPath = Path.Combine(@"C:\Test\Unsorted\movies\".AsOsAgnostic(), name);
|
||||
var localMovie = _approvedDecisions.First().LocalMovie;
|
||||
|
||||
localMovie.FolderMovieInfo = new ParsedMovieInfo { ReleaseTitle = name };
|
||||
localMovie.Path = Path.Combine(outputPath, "subfolder", name + ".mkv");
|
||||
|
||||
Subject.Import(new List<ImportDecision> { _approvedDecisions.First() }, true, _downloadClientItem);
|
||||
|
||||
Mocker.GetMock<IMediaFileService>().Verify(v => v.Add(It.Is<MovieFile>(c => c.OriginalFilePath == $"subfolder\\{name}.mkv".AsOsAgnostic())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ private string GetOriginalFilePath(DownloadClientItem downloadClientItem, LocalM
|
||||
{
|
||||
var path = localMovie.Path;
|
||||
|
||||
if (downloadClientItem != null)
|
||||
if (downloadClientItem != null && !downloadClientItem.OutputPath.IsEmpty)
|
||||
{
|
||||
var outputDirectory = downloadClientItem.OutputPath.Directory.ToString();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user