Fixes: Missing default path for Download Station

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

(cherrypicked from 4bf3ab1511b4ea25642476bf9df13f91b6f73d76)

Closes #6508
pull/6610/head
Mark McDowall 3 years ago committed by Qstick
parent 88d516a6d4
commit db7babc6ed

@ -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]

@ -313,7 +313,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]

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

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

Loading…
Cancel
Save