mirror of
https://github.com/Sonarr/Sonarr
synced 2026-05-09 05:40:53 +02:00
Correctly parse backslashes from Transmission
This commit is contained in:
parent
9ebe043bd9
commit
7089a983b5
2 changed files with 31 additions and 1 deletions
|
|
@ -273,6 +273,35 @@ public void should_fix_forward_slashes()
|
|||
items.First().OutputPath.Should().Be(@"C:\Downloads\Finished\transmission\" + _title);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_fix_backward_slashes()
|
||||
{
|
||||
WindowsOnly();
|
||||
|
||||
_downloading.DownloadDir = @"C:/Downloads/Finished/transmission";
|
||||
|
||||
GivenTorrents(new List<TransmissionTorrent>
|
||||
{
|
||||
new TransmissionTorrent
|
||||
{
|
||||
HashString = "HASH",
|
||||
IsFinished = false,
|
||||
Status = TransmissionTorrentStatus.Downloading,
|
||||
Name = "Don\'t Look Back in Anger",
|
||||
TotalSize = 1000,
|
||||
LeftUntilDone = 100,
|
||||
DownloadDir = "Can\'t touch this"
|
||||
};
|
||||
});
|
||||
|
||||
var items = Subject.GetItems().ToList();
|
||||
|
||||
items.Should().HaveCount(1);
|
||||
items.First().OutputPath.Should().Be(
|
||||
@"C:\Downloads\Finished\transmission\" + \
|
||||
@"Can\'t touch this\Don't Look Back in Anger");
|
||||
}
|
||||
|
||||
[TestCase("2.84 ()")]
|
||||
[TestCase("2.84+ ()")]
|
||||
[TestCase("2.84 (other info)")]
|
||||
|
|
|
|||
|
|
@ -258,7 +258,8 @@ protected override void Test(List<ValidationFailure> failures)
|
|||
|
||||
protected virtual OsPath GetOutputPath(OsPath outputPath, TransmissionTorrent torrent)
|
||||
{
|
||||
return outputPath + torrent.Name.Replace(":", "_");
|
||||
var safeName = torrent.Name.Replace(":", "_");
|
||||
return outputPath + new OsPath(safeName, OsPathKind.Unknown);
|
||||
}
|
||||
|
||||
protected string GetDownloadDirectory()
|
||||
|
|
|
|||
Loading…
Reference in a new issue