From 758228e1597f25f3f46a15b8dbc1a80f77619db2 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Sun, 12 Feb 2017 20:07:57 -0500 Subject: [PATCH] Update dl-clients (#732) --- .../Clients/Blackhole/TorrentBlackhole.cs | 12 +++---- .../Clients/Blackhole/UsenetBlackhole.cs | 2 +- .../Download/Clients/Deluge/Deluge.cs | 6 ++-- .../Download/Clients/Deluge/DelugeSettings.cs | 2 +- .../Download/Clients/Hadouken/Hadouken.cs | 8 ++--- .../Download/Clients/NzbVortex/NzbVortex.cs | 11 +------ .../Clients/NzbVortex/NzbVortexSettings.cs | 2 +- .../Download/Clients/Nzbget/Nzbget.cs | 15 +-------- .../Download/Clients/Pneumatic/Pneumatic.cs | 31 +++---------------- .../Clients/QBittorrent/QBittorrent.cs | 4 +-- .../QBittorrent/QBittorrentSettings.cs | 2 +- .../Download/Clients/Sabnzbd/Sabnzbd.cs | 12 +------ .../Clients/Sabnzbd/SabnzbdSettings.cs | 2 +- .../Clients/Transmission/TransmissionBase.cs | 4 +-- .../Transmission/TransmissionSettings.cs | 1 + .../Download/Clients/uTorrent/UTorrent.cs | 30 +++--------------- 16 files changed, 35 insertions(+), 109 deletions(-) diff --git a/src/NzbDrone.Core/Download/Clients/Blackhole/TorrentBlackhole.cs b/src/NzbDrone.Core/Download/Clients/Blackhole/TorrentBlackhole.cs index f8b19e248..5e29aaf19 100644 --- a/src/NzbDrone.Core/Download/Clients/Blackhole/TorrentBlackhole.cs +++ b/src/NzbDrone.Core/Download/Clients/Blackhole/TorrentBlackhole.cs @@ -40,23 +40,23 @@ namespace NzbDrone.Core.Download.Clients.Blackhole protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink) { - throw new NotImplementedException("Episodes are not working with Radarr"); + throw new DownloadClientException("Episodes are not working with Radarr"); } protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent) { - throw new NotImplementedException("Episodes are not working with Radarr"); + throw new DownloadClientException("Episodes are not working with Radarr"); } - protected override string AddFromMagnetLink(RemoteMovie remoteEpisode, string hash, string magnetLink) + protected override string AddFromMagnetLink(RemoteMovie remoteMovie, string hash, string magnetLink) { if (!Settings.SaveMagnetFiles) { throw new NotSupportedException("Blackhole does not support magnet links."); } - var title = remoteEpisode.Release.Title; + var title = remoteMovie.Release.Title; title = FileNameBuilder.CleanFileName(title); @@ -73,9 +73,9 @@ namespace NzbDrone.Core.Download.Clients.Blackhole return null; } - protected override string AddFromTorrentFile(RemoteMovie remoteEpisode, string hash, string filename, byte[] fileContent) + protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string hash, string filename, byte[] fileContent) { - var title = remoteEpisode.Release.Title; + var title = remoteMovie.Release.Title; title = FileNameBuilder.CleanFileName(title); diff --git a/src/NzbDrone.Core/Download/Clients/Blackhole/UsenetBlackhole.cs b/src/NzbDrone.Core/Download/Clients/Blackhole/UsenetBlackhole.cs index bb40d652f..1a5dde9d4 100644 --- a/src/NzbDrone.Core/Download/Clients/Blackhole/UsenetBlackhole.cs +++ b/src/NzbDrone.Core/Download/Clients/Blackhole/UsenetBlackhole.cs @@ -34,7 +34,7 @@ namespace NzbDrone.Core.Download.Clients.Blackhole protected override string AddFromNzbFile(RemoteEpisode remoteEpisode, string filename, byte[] fileContents) { - throw new NotImplementedException("Episodes are not working with Radarr"); + throw new DownloadClientException("Episodes are not working with Radarr"); } protected override string AddFromNzbFile(RemoteMovie remoteMovie, string filename, byte[] fileContents) diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs index 831c31b4f..a0dc79c15 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs @@ -45,7 +45,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge return actualHash.ToUpper(); } - protected override string AddFromTorrentFile(RemoteMovie remoteEpisode, string hash, string filename, byte[] fileContent) + protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string hash, string filename, byte[] fileContent) { var actualHash = _proxy.AddTorrentFromFile(filename, fileContent, Settings); @@ -61,12 +61,12 @@ namespace NzbDrone.Core.Download.Clients.Deluge protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink) { - throw new NotImplementedException("Episodes are not working with Radarr"); + throw new DownloadClientException("Episodes are not working with Radarr"); } protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent) { - throw new NotImplementedException("Episodes are not working with Radarr"); + throw new DownloadClientException("Episodes are not working with Radarr"); } public override string Name => "Deluge"; diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs index 679f422b4..2ced9ab5f 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs @@ -25,7 +25,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge Host = "localhost"; Port = 8112; Password = "deluge"; - MovieCategory = "movie-radarr"; + MovieCategory = "radarr"; } [FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)] diff --git a/src/NzbDrone.Core/Download/Clients/Hadouken/Hadouken.cs b/src/NzbDrone.Core/Download/Clients/Hadouken/Hadouken.cs index 2a130863a..5418f702d 100644 --- a/src/NzbDrone.Core/Download/Clients/Hadouken/Hadouken.cs +++ b/src/NzbDrone.Core/Download/Clients/Hadouken/Hadouken.cs @@ -151,22 +151,22 @@ namespace NzbDrone.Core.Download.Clients.Hadouken protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink) { - throw new NotImplementedException("Episodes are not working with Radarr"); + throw new DownloadClientException("Episodes are not working with Radarr"); } protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent) { - throw new NotImplementedException("Episodes are not working with Radarr"); + throw new DownloadClientException("Episodes are not working with Radarr"); } - protected override string AddFromMagnetLink(RemoteMovie remoteEpisode, string hash, string magnetLink) + protected override string AddFromMagnetLink(RemoteMovie remoteMovie, string hash, string magnetLink) { _proxy.AddTorrentUri(Settings, magnetLink); return hash.ToUpper(); } - protected override string AddFromTorrentFile(RemoteMovie remoteEpisode, string hash, string filename, byte[] fileContent) + protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string hash, string filename, byte[] fileContent) { return _proxy.AddTorrentFile(Settings, fileContent).ToUpper(); } diff --git a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs index ce29dafad..5753b4c67 100644 --- a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs +++ b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs @@ -31,16 +31,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex protected override string AddFromNzbFile(RemoteEpisode remoteEpisode, string filename, byte[] fileContents) { - var priority = remoteEpisode.IsRecentEpisode() ? Settings.RecentTvPriority : Settings.OlderTvPriority; - - var response = _proxy.DownloadNzb(fileContents, filename, priority, Settings); - - if (response == null) - { - throw new DownloadClientException("Failed to add nzb {0}", filename); - } - - return response; + throw new DownloadClientException("Episodes are not working with Radarr"); } protected override string AddFromNzbFile(RemoteMovie remoteMovie, string filename, byte[] fileContents) diff --git a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexSettings.cs b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexSettings.cs index 4642e18f6..8e956cbd9 100644 --- a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexSettings.cs @@ -29,7 +29,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex { Host = "localhost"; Port = 4321; - TvCategory = "TV Shows"; + TvCategory = "Movies"; RecentTvPriority = (int)NzbVortexPriority.Normal; OlderTvPriority = (int)NzbVortexPriority.Normal; } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs index 19eb08e86..fd9ba654e 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs @@ -31,20 +31,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget protected override string AddFromNzbFile(RemoteEpisode remoteEpisode, string filename, byte[] fileContents) { - var category = Settings.TvCategory; - - var priority = remoteEpisode.IsRecentEpisode() ? Settings.RecentTvPriority : Settings.OlderTvPriority; - - var addpaused = Settings.AddPaused; - - var response = _proxy.DownloadNzb(fileContents, filename, category, priority, addpaused, Settings); - - if (response == null) - { - throw new DownloadClientException("Failed to add nzb {0}", filename); - } - - return response; + throw new DownloadClientException("Episodes are not working with Radarr"); } protected override string AddFromNzbFile(RemoteMovie remoteMovie, string filename, byte[] fileContents) diff --git a/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs b/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs index 299a56b13..bd1fd661d 100644 --- a/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs +++ b/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs @@ -34,36 +34,15 @@ namespace NzbDrone.Core.Download.Clients.Pneumatic public override string Download(RemoteEpisode remoteEpisode) { - var url = remoteEpisode.Release.DownloadUrl; - var title = remoteEpisode.Release.Title; - - if (remoteEpisode.ParsedEpisodeInfo.FullSeason) - { - throw new NotSupportedException("Full season releases are not supported with Pneumatic."); - } - - title = FileNameBuilder.CleanFileName(title); - - //Save to the Pneumatic directory (The user will need to ensure its accessible by XBMC) - var nzbFile = Path.Combine(Settings.NzbFolder, title + ".nzb"); - - _logger.Debug("Downloading NZB from: {0} to: {1}", url, nzbFile); - _httpClient.DownloadFile(url, nzbFile); - - _logger.Debug("NZB Download succeeded, saved to: {0}", nzbFile); - - var strmFile = WriteStrmFile(title, nzbFile); - - - return GetDownloadClientId(strmFile); + throw new DownloadClientException("Episodes are not working with Radarr"); } - public override string Download(RemoteMovie remoteEpisode) + public override string Download(RemoteMovie remoteMovie) { - var url = remoteEpisode.Release.DownloadUrl; - var title = remoteEpisode.Release.Title; + var url = remoteMovie.Release.DownloadUrl; + var title = remoteMovie.Release.Title; - if (remoteEpisode.ParsedEpisodeInfo.FullSeason) + if (remoteMovie.ParsedEpisodeInfo.FullSeason) { throw new NotSupportedException("Full season releases are not supported with Pneumatic."); } diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs index 5db723ff0..c352b92a3 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs @@ -33,12 +33,12 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink) { - throw new NotImplementedException("Episodes are not working with Radarr"); + throw new DownloadClientException("Episodes are not working with Radarr"); } protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, Byte[] fileContent) { - throw new NotImplementedException("Episodes are not working with Radarr"); + throw new DownloadClientException("Episodes are not working with Radarr"); } protected override string AddFromMagnetLink(RemoteMovie remoteMovie, string hash, string magnetLink) diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentSettings.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentSettings.cs index b5127293d..3b5ae2f33 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentSettings.cs @@ -22,7 +22,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent { Host = "localhost"; Port = 9091; - MovieCategory = "movie-radarr"; + MovieCategory = "radarr"; } [FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)] diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs index 52fef65b0..5d11f6b4c 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs @@ -34,17 +34,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd protected override string AddFromNzbFile(RemoteEpisode remoteEpisode, string filename, byte[] fileContents) { - var category = Settings.TvCategory; - var priority = remoteEpisode.IsRecentEpisode() ? Settings.RecentTvPriority : Settings.OlderTvPriority; - - var response = _proxy.DownloadNzb(fileContents, filename, category, priority, Settings); - - if (response != null && response.Ids.Any()) - { - return response.Ids.First(); - } - - return null; + throw new DownloadClientException("Episodes are not working with Radarr"); } protected override string AddFromNzbFile(RemoteMovie remoteMovie, string filename, byte[] fileContents) diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs index 346629f04..183c1c899 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs @@ -38,7 +38,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd { Host = "localhost"; Port = 8080; - TvCategory = "tv"; + TvCategory = "movies"; RecentTvPriority = (int)SabnzbdPriority.Default; OlderTvPriority = (int)SabnzbdPriority.Default; } diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs index 1eb6b6ce8..aad780a47 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs @@ -137,12 +137,12 @@ namespace NzbDrone.Core.Download.Clients.Transmission protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink) { - throw new NotImplementedException("Episodes are not working with Radarr"); + throw new DownloadClientException("Episodes are not working with Radarr"); } protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent) { - throw new NotImplementedException("Episodes are not working with Radarr"); + throw new DownloadClientException("Episodes are not working with Radarr"); } protected override string AddFromMagnetLink(RemoteMovie remoteMovie, string hash, string magnetLink) diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs index aeb8887c4..477e2d84a 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs @@ -33,6 +33,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission Host = "localhost"; Port = 9091; UrlBase = "/transmission/"; + MovieCategory = "radarr"; } [FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)] diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs index 171910744..eff3a5850 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs @@ -38,37 +38,15 @@ namespace NzbDrone.Core.Download.Clients.UTorrent protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink) { - _proxy.AddTorrentFromUrl(magnetLink, Settings); - _proxy.SetTorrentLabel(hash, Settings.TvCategory, Settings); - - var isRecentEpisode = remoteEpisode.IsRecentEpisode(); - - if (isRecentEpisode && Settings.RecentTvPriority == (int)UTorrentPriority.First || - !isRecentEpisode && Settings.OlderTvPriority == (int)UTorrentPriority.First) - { - _proxy.MoveTorrentToTopInQueue(hash, Settings); - } - - return hash; + throw new DownloadClientException("Episodes are not working with Radarr"); } protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent) { - _proxy.AddTorrentFromFile(filename, fileContent, Settings); - _proxy.SetTorrentLabel(hash, Settings.TvCategory, Settings); - - var isRecentEpisode = remoteEpisode.IsRecentEpisode(); - - if (isRecentEpisode && Settings.RecentTvPriority == (int)UTorrentPriority.First || - !isRecentEpisode && Settings.OlderTvPriority == (int)UTorrentPriority.First) - { - _proxy.MoveTorrentToTopInQueue(hash, Settings); - } - - return hash; + throw new DownloadClientException("Episodes are not working with Radarr"); } - protected override string AddFromMagnetLink(RemoteMovie remoteEpisode, string hash, string magnetLink) + protected override string AddFromMagnetLink(RemoteMovie remoteMovie, string hash, string magnetLink) { _proxy.AddTorrentFromUrl(magnetLink, Settings); _proxy.SetTorrentLabel(hash, Settings.TvCategory, Settings); @@ -84,7 +62,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent return hash; } - protected override string AddFromTorrentFile(RemoteMovie remoteEpisode, string hash, string filename, byte[] fileContent) + protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string hash, string filename, byte[] fileContent) { _proxy.AddTorrentFromFile(filename, fileContent, Settings); _proxy.SetTorrentLabel(hash, Settings.TvCategory, Settings);