Improve default path for Synology Download Station

Fixes: Missing default path for Download Station
Fixes: Error when getting destination path for Synology Download Station in health check

(cherry picked from commit 4bf3ab1511b4ea25642476bf9df13f91b6f73d76)
pull/1362/head
Mark McDowall 3 years ago committed by ta264
parent 326d395da4
commit 621bb20756

@ -431,7 +431,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
id.Should().NotBeNullOrEmpty(); id.Should().NotBeNullOrEmpty();
Mocker.GetMock<IDownloadStationTaskProxy>() Mocker.GetMock<IDownloadStationTaskProxy>()
.Verify(v => v.AddTaskFromUrl(It.IsAny<string>(), null, It.IsAny<DownloadStationSettings>()), Times.Once()); .Verify(v => v.AddTaskFromUrl(It.IsAny<string>(), _defaultDestination, It.IsAny<DownloadStationSettings>()), Times.Once());
} }
[Test] [Test]

@ -308,7 +308,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
id.Should().NotBeNullOrEmpty(); id.Should().NotBeNullOrEmpty();
Mocker.GetMock<IDownloadStationTaskProxy>() Mocker.GetMock<IDownloadStationTaskProxy>()
.Verify(v => v.AddTaskFromData(It.IsAny<byte[]>(), It.IsAny<string>(), null, It.IsAny<DownloadStationSettings>()), Times.Once()); .Verify(v => v.AddTaskFromData(It.IsAny<byte[]>(), It.IsAny<string>(), _defaultDestination, It.IsAny<DownloadStationSettings>()), Times.Once());
} }
[Test] [Test]

@ -450,14 +450,15 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
{ {
return Settings.TvDirectory.TrimStart('/'); return Settings.TvDirectory.TrimStart('/');
} }
else if (Settings.MusicCategory.IsNotNullOrWhiteSpace())
{
var destDir = GetDefaultDir();
var destDir = GetDefaultDir();
if (Settings.MusicCategory.IsNotNullOrWhiteSpace())
{
return $"{destDir.TrimEnd('/')}/{Settings.MusicCategory}"; return $"{destDir.TrimEnd('/')}/{Settings.MusicCategory}";
} }
return null; return destDir.TrimEnd('/');
} }
} }
} }

@ -426,14 +426,15 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
{ {
return Settings.TvDirectory.TrimStart('/'); return Settings.TvDirectory.TrimStart('/');
} }
else if (Settings.MusicCategory.IsNotNullOrWhiteSpace())
{
var destDir = GetDefaultDir();
var destDir = GetDefaultDir();
if (Settings.MusicCategory.IsNotNullOrWhiteSpace())
{
return $"{destDir.TrimEnd('/')}/{Settings.MusicCategory}"; return $"{destDir.TrimEnd('/')}/{Settings.MusicCategory}";
} }
return null; return destDir.TrimEnd('/');
} }
} }
} }

Loading…
Cancel
Save