diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/QBittorrentTests/QBittorrentFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/QBittorrentTests/QBittorrentFixture.cs index 3ceece6f6..2283f7add 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/QBittorrentTests/QBittorrentFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/QBittorrentTests/QBittorrentFixture.cs @@ -25,7 +25,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests Port = 2222, Username = "admin", Password = "pass", - TvCategory = "tv" + MovieCategory = "movies-radarr" }; Mocker.GetMock() diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs index 4d4dc47db..5db723ff0 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs @@ -33,81 +33,35 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink) { - _proxy.AddTorrentFromUrl(magnetLink, Settings); - - if (Settings.TvCategory.IsNotNullOrWhiteSpace()) - { - _proxy.SetTorrentLabel(hash.ToLower(), Settings.TvCategory, Settings); - } - - var isRecentEpisode = remoteEpisode.IsRecentEpisode(); - - if (isRecentEpisode && Settings.RecentTvPriority == (int)QBittorrentPriority.First || - !isRecentEpisode && Settings.OlderTvPriority == (int)QBittorrentPriority.First) - { - _proxy.MoveTorrentToTopInQueue(hash.ToLower(), Settings); - } - - return hash; + throw new NotImplementedException("Episodes are not working with Radarr"); } protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, Byte[] fileContent) { - _proxy.AddTorrentFromFile(filename, fileContent, Settings); - - if (Settings.TvCategory.IsNotNullOrWhiteSpace()) - { - _proxy.SetTorrentLabel(hash.ToLower(), Settings.TvCategory, Settings); - } - - var isRecentEpisode = remoteEpisode.IsRecentEpisode(); - - if (isRecentEpisode && Settings.RecentTvPriority == (int)QBittorrentPriority.First || - !isRecentEpisode && Settings.OlderTvPriority == (int)QBittorrentPriority.First) - { - _proxy.MoveTorrentToTopInQueue(hash.ToLower(), Settings); - } - - return hash; + throw new NotImplementedException("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); - if (Settings.TvCategory.IsNotNullOrWhiteSpace()) + if (Settings.MovieCategory.IsNotNullOrWhiteSpace()) { - _proxy.SetTorrentLabel(hash.ToLower(), Settings.TvCategory, Settings); + _proxy.SetTorrentLabel(hash.ToLower(), Settings.MovieCategory, Settings); } - /*var isRecentEpisode = remoteEpisode.IsRecentEpisode(); - - if (isRecentEpisode && Settings.RecentTvPriority == (int)QBittorrentPriority.First || - !isRecentEpisode && Settings.OlderTvPriority == (int)QBittorrentPriority.First) - { - _proxy.MoveTorrentToTopInQueue(hash.ToLower(), Settings); - }*/ //TODO: Maybe reimplement for movies - 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); - if (Settings.TvCategory.IsNotNullOrWhiteSpace()) + if (Settings.MovieCategory.IsNotNullOrWhiteSpace()) { - _proxy.SetTorrentLabel(hash.ToLower(), Settings.TvCategory, Settings); + _proxy.SetTorrentLabel(hash.ToLower(), Settings.MovieCategory, Settings); } - /*var isRecentEpisode = remoteEpisode.IsRecentEpisode(); - - if (isRecentEpisode && Settings.RecentTvPriority == (int)QBittorrentPriority.First || - !isRecentEpisode && Settings.OlderTvPriority == (int)QBittorrentPriority.First) - { - _proxy.MoveTorrentToTopInQueue(hash.ToLower(), Settings); - }*/ - return hash; } @@ -236,7 +190,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent else if (version < 6) { // API version 6 introduced support for labels - if (Settings.TvCategory.IsNotNullOrWhiteSpace()) + if (Settings.MovieCategory.IsNotNullOrWhiteSpace()) { return new NzbDroneValidationFailure("Category", "Category is not supported") { @@ -244,7 +198,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent }; } } - else if (Settings.TvCategory.IsNullOrWhiteSpace()) + else if (Settings.MovieCategory.IsNullOrWhiteSpace()) { // warn if labels are supported, but category is not provided return new NzbDroneValidationFailure("TvCategory", "Category is recommended") diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxy.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxy.cs index e00c57585..be4ca16c5 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxy.cs @@ -58,8 +58,8 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent public List GetTorrents(QBittorrentSettings settings) { var request = BuildRequest(settings).Resource("/query/torrents") - .AddQueryParam("label", settings.TvCategory) - .AddQueryParam("category", settings.TvCategory); + .AddQueryParam("label", settings.MovieCategory) + .AddQueryParam("category", settings.MovieCategory); var response = ProcessRequest>(request, settings); diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentSettings.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentSettings.cs index d139d244b..c02619f2f 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; - TvCategory = "movie-radarr"; + MovieCategory = "movie-radarr"; } [FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)] @@ -38,16 +38,9 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent public string Password { get; set; } [FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Radarr avoids conflicts with unrelated downloads, but it's optional")] - public string TvCategory { get; set; } + public string MovieCategory { get; set; } - //Todo: update this shit. - [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(QBittorrentPriority), HelpText = "Priority to use when grabbing episodes that aired within the last 14 days")] - public int RecentTvPriority { get; set; } - - [FieldDefinition(6, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(QBittorrentPriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")] - public int OlderTvPriority { get; set; } - - [FieldDefinition(7, Label = "Use SSL", Type = FieldType.Checkbox, HelpText = "Use a secure connection. See Options -> Web UI -> 'Use HTTPS instead of HTTP' in qBittorrent.")] + [FieldDefinition(5, Label = "Use SSL", Type = FieldType.Checkbox, HelpText = "Use a secure connection. See Options -> Web UI -> 'Use HTTPS instead of HTTP' in qBittorrent.")] public bool UseSsl { get; set; } public NzbDroneValidationResult Validate()