From 17ff86aaea2f2db8a5610efe54b329a6b3137be7 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 1 Aug 2021 13:17:03 -0700 Subject: [PATCH] Fixes: Missing default path for Download Station (cherry picked from commit 4bf3ab1511b4ea25642476bf9df13f91b6f73d76) Closes #2062 --- .../Clients/DownloadStation/TorrentDownloadStation.cs | 9 +++++---- .../Clients/DownloadStation/UsenetDownloadStation.cs | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs b/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs index 17cf57246..482e86e30 100644 --- a/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs +++ b/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs @@ -308,14 +308,15 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation { return Settings.TvDirectory.TrimStart('/'); } - else if (Settings.Category.IsNotNullOrWhiteSpace()) - { - var destDir = GetDefaultDir(); + var destDir = GetDefaultDir(); + + if (destDir.IsNotNullOrWhiteSpace() && Settings.Category.IsNotNullOrWhiteSpace()) + { return $"{destDir.TrimEnd('/')}/{Settings.Category}"; } - return null; + return destDir.TrimEnd('/'); } protected override string AddFromTorrentLink(TorrentInfo release, string hash, string torrentLink) diff --git a/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs b/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs index 562d6d975..4661c6518 100644 --- a/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs +++ b/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs @@ -274,14 +274,15 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation { return Settings.TvDirectory.TrimStart('/'); } - else if (Settings.Category.IsNotNullOrWhiteSpace()) - { - var destDir = GetDefaultDir(); + var destDir = GetDefaultDir(); + + if (destDir.IsNotNullOrWhiteSpace() && Settings.Category.IsNotNullOrWhiteSpace()) + { return $"{destDir.TrimEnd('/')}/{Settings.Category}"; } - return null; + return destDir.TrimEnd('/'); } protected override string AddFromLink(ReleaseInfo release)