mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 20:12:41 +02:00
Fixed: Getting parent of UNC paths
This commit is contained in:
parent
3f0903d8ab
commit
e610b74745
@ -314,5 +314,37 @@ public void should_use_folder_info_original_title_to_find_relative_path()
|
||||
|
||||
Mocker.GetMock<IMediaFileService>().Verify(v => v.Add(It.Is<MovieFile>(c => c.OriginalFilePath == $"{name}\\subfolder\\{name}.mkv".AsOsAgnostic())));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_get_relative_path_when_there_is_no_grandparent()
|
||||
{
|
||||
var name = "Transformers.2007.720p.BluRay.x264-Radarr";
|
||||
var outputPath = @"C:\".AsOsAgnostic();
|
||||
var localMovie = _approvedDecisions.First().LocalMovie;
|
||||
|
||||
localMovie.FolderMovieInfo = new ParsedMovieInfo { ReleaseTitle = name };
|
||||
localMovie.Path = Path.Combine(outputPath, name + ".mkv");
|
||||
|
||||
Subject.Import(new List<ImportDecision> { _approvedDecisions.First() }, true, null);
|
||||
|
||||
Mocker.GetMock<IMediaFileService>().Verify(v => v.Add(It.Is<MovieFile>(c => c.OriginalFilePath == $"{name}.mkv".AsOsAgnostic())));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_get_relative_path_when_there_is_no_grandparent_for_UNC_path()
|
||||
{
|
||||
WindowsOnly();
|
||||
|
||||
var name = "Transformers.2007.720p.BluRay.x264-Radarr";
|
||||
var outputPath = @"\\server\share";
|
||||
var localMovie = _approvedDecisions.First().LocalMovie;
|
||||
|
||||
localMovie.FolderMovieInfo = new ParsedMovieInfo { ReleaseTitle = name };
|
||||
localMovie.Path = Path.Combine(outputPath, name + ".mkv");
|
||||
|
||||
Subject.Import(new List<ImportDecision> { _approvedDecisions.First() }, true, null);
|
||||
|
||||
Mocker.GetMock<IMediaFileService>().Verify(v => v.Add(It.Is<MovieFile>(c => c.OriginalFilePath == $"{name}.mkv")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user