From e8771c9c781f87a0781db651d910ef3ad13b302e Mon Sep 17 00:00:00 2001 From: Qstick Date: Thu, 15 Feb 2018 21:52:15 -0500 Subject: [PATCH] Rename TvCategory to MusicCategory for Clients --- .../DelugeTests/DelugeFixture.cs | 2 +- .../TorrentDownloadStationFixture.cs | 2 +- .../UsenetDownloadStationFixture.cs | 2 +- .../NzbVortexTests/NzbVortexFixture.cs | 4 ++-- .../NzbgetTests/NzbgetFixture.cs | 2 +- .../QBittorrentTests/QBittorrentFixture.cs | 2 +- .../RTorrentTests/RTorrentFixture.cs | 2 +- .../SabnzbdTests/SabnzbdFixture.cs | 4 ++-- .../TransmissionFixtureBase.cs | 2 +- .../UTorrentTests/UTorrentFixture.cs | 2 +- .../Download/Clients/Deluge/Deluge.cs | 22 +++++++++---------- .../Download/Clients/Deluge/DelugeSettings.cs | 6 ++--- .../DownloadStationSettings.cs | 8 +++---- .../DownloadStation/TorrentDownloadStation.cs | 12 +++++----- .../DownloadStation/UsenetDownloadStation.cs | 12 +++++----- .../Download/Clients/NzbVortex/NzbVortex.cs | 4 ++-- .../Clients/NzbVortex/NzbVortexProxy.cs | 8 +++---- .../Clients/NzbVortex/NzbVortexSettings.cs | 8 +++---- .../Download/Clients/Nzbget/Nzbget.cs | 8 +++---- .../Download/Clients/Nzbget/NzbgetSettings.cs | 6 ++--- .../Clients/QBittorrent/QBittorrent.cs | 12 +++++----- .../Clients/QBittorrent/QBittorrentProxy.cs | 12 +++++----- .../QBittorrent/QBittorrentSettings.cs | 4 ++-- .../Download/Clients/Sabnzbd/Sabnzbd.cs | 18 +++++++-------- .../Clients/Sabnzbd/SabnzbdSettings.cs | 8 +++---- .../Clients/Transmission/TransmissionBase.cs | 14 ++++++------ .../Transmission/TransmissionSettings.cs | 6 ++--- .../Download/Clients/rTorrent/RTorrent.cs | 6 ++--- .../Clients/rTorrent/RTorrentSettings.cs | 8 +++---- .../Download/Clients/uTorrent/UTorrent.cs | 10 ++++----- .../Clients/uTorrent/UTorrentSettings.cs | 6 ++--- 31 files changed, 111 insertions(+), 111 deletions(-) diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/DelugeTests/DelugeFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/DelugeTests/DelugeFixture.cs index 49d157a45..19488834c 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/DelugeTests/DelugeFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/DelugeTests/DelugeFixture.cs @@ -27,7 +27,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DelugeTests Subject.Definition = new DownloadClientDefinition(); Subject.Definition.Settings = new DelugeSettings() { - TvCategory = null + MusicCategory = null }; _queued = new DelugeTorrent diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadStationTests/TorrentDownloadStationFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadStationTests/TorrentDownloadStationFixture.cs index fbec5b2d6..5b0821a5e 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadStationTests/TorrentDownloadStationFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadStationTests/TorrentDownloadStationFixture.cs @@ -296,7 +296,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests protected void GivenTvCategory() { - _settings.TvCategory = _category; + _settings.MusicCategory = _category; } protected void GivenTvDirectory() diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadStationTests/UsenetDownloadStationFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadStationTests/UsenetDownloadStationFixture.cs index badba80e6..0c870745d 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadStationTests/UsenetDownloadStationFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadStationTests/UsenetDownloadStationFixture.cs @@ -198,7 +198,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests protected void GivenTvCategory() { - _settings.TvCategory = _category; + _settings.MusicCategory = _category; } protected void GivenTvDirectory() diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbVortexTests/NzbVortexFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbVortexTests/NzbVortexFixture.cs index c33bd564a..d075029f9 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbVortexTests/NzbVortexFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbVortexTests/NzbVortexFixture.cs @@ -32,7 +32,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbVortexTests Host = "127.0.0.1", Port = 2222, ApiKey = "1234-ABCD", - TvCategory = "Music", + MusicCategory = "Music", RecentTvPriority = (int)NzbgetPriority.High }; @@ -298,7 +298,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbVortexTests { Mocker.GetMock() .Setup(v => v.GetGroups(It.IsAny())) - .Returns(new List { new NzbVortexGroup { GroupName = ((NzbVortexSettings)Subject.Definition.Settings).TvCategory } }); + .Returns(new List { new NzbVortexGroup { GroupName = ((NzbVortexSettings)Subject.Definition.Settings).MusicCategory } }); Mocker.GetMock() .Setup(v => v.GetApiVersion(It.IsAny())) diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs index 2da8f4d50..8fd776316 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs @@ -31,7 +31,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests Port = 2222, Username = "admin", Password = "pass", - TvCategory = "music", + MusicCategory = "music", RecentTvPriority = (int)NzbgetPriority.High }; diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/QBittorrentTests/QBittorrentFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/QBittorrentTests/QBittorrentFixture.cs index 0bd729670..6a48a76a7 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" + MusicCategory = "tv" }; Mocker.GetMock() diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/RTorrentTests/RTorrentFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/RTorrentTests/RTorrentFixture.cs index 261925758..30b72748a 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/RTorrentTests/RTorrentFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/RTorrentTests/RTorrentFixture.cs @@ -21,7 +21,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.RTorrentTests Subject.Definition = new DownloadClientDefinition(); Subject.Definition.Settings = new RTorrentSettings() { - TvCategory = null + MusicCategory = null }; _downloading = new RTorrentTorrent diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs index c0940032b..c2140768e 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs @@ -36,7 +36,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests ApiKey = "5c770e3197e4fe763423ee7c392c25d1", Username = "admin", Password = "pass", - TvCategory = "tv", + MusicCategory = "tv", RecentTvPriority = (int)SabnzbdPriority.High }; _queued = new SabnzbdQueue @@ -568,7 +568,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests [Test] public void should_test_failed_if_tv_sorting_default_category() { - Subject.Definition.Settings.As().TvCategory = null; + Subject.Definition.Settings.As().MusicCategory = null; _config.Misc.enable_tv_sorting = true; _config.Misc.tv_categories = new[] { "Default" }; diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/TransmissionTests/TransmissionFixtureBase.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/TransmissionTests/TransmissionFixtureBase.cs index 1d9787792..1a5179301 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/TransmissionTests/TransmissionFixtureBase.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/TransmissionTests/TransmissionFixtureBase.cs @@ -112,7 +112,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests protected void GivenTvCategory() { - _settings.TvCategory = "Lidarr"; + _settings.MusicCategory = "Lidarr"; } protected void GivenTvDirectory() diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/UTorrentTests/UTorrentFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/UTorrentTests/UTorrentFixture.cs index 9071d8050..89cc667d6 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/UTorrentTests/UTorrentFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/UTorrentTests/UTorrentFixture.cs @@ -30,7 +30,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.UTorrentTests Port = 2222, Username = "admin", Password = "pass", - TvCategory = "lidarr" + MusicCategory = "lidarr" }; _queued = new UTorrentTorrent diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs index fbe6367b7..eb2ed2541 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs @@ -35,9 +35,9 @@ namespace NzbDrone.Core.Download.Clients.Deluge { var actualHash = _proxy.AddTorrentFromMagnet(magnetLink, Settings); - if (!Settings.TvCategory.IsNullOrWhiteSpace()) + if (!Settings.MusicCategory.IsNullOrWhiteSpace()) { - _proxy.SetLabel(actualHash, Settings.TvCategory, Settings); + _proxy.SetLabel(actualHash, Settings.MusicCategory, Settings); } var isRecentAlbum = remoteAlbum.IsRecentAlbum(); @@ -60,9 +60,9 @@ namespace NzbDrone.Core.Download.Clients.Deluge throw new DownloadClientException("Deluge failed to add torrent " + filename); } - if (!Settings.TvCategory.IsNullOrWhiteSpace()) + if (!Settings.MusicCategory.IsNullOrWhiteSpace()) { - _proxy.SetLabel(actualHash, Settings.TvCategory, Settings); + _proxy.SetLabel(actualHash, Settings.MusicCategory, Settings); } var isRecentAlbum = remoteAlbum.IsRecentAlbum(); @@ -82,9 +82,9 @@ namespace NzbDrone.Core.Download.Clients.Deluge { IEnumerable torrents; - if (!Settings.TvCategory.IsNullOrWhiteSpace()) + if (!Settings.MusicCategory.IsNullOrWhiteSpace()) { - torrents = _proxy.GetTorrentsByLabel(Settings.TvCategory, Settings); + torrents = _proxy.GetTorrentsByLabel(Settings.MusicCategory, Settings); } else { @@ -98,7 +98,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge var item = new DownloadClientItem(); item.DownloadId = torrent.Hash.ToUpper(); item.Title = torrent.Name; - item.Category = Settings.TvCategory; + item.Category = Settings.MusicCategory; item.DownloadClient = Definition.Name; @@ -231,7 +231,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge private ValidationFailure TestCategory() { - if (Settings.TvCategory.IsNullOrWhiteSpace()) + if (Settings.MusicCategory.IsNullOrWhiteSpace()) { return null; } @@ -248,12 +248,12 @@ namespace NzbDrone.Core.Download.Clients.Deluge var labels = _proxy.GetAvailableLabels(Settings); - if (!labels.Contains(Settings.TvCategory)) + if (!labels.Contains(Settings.MusicCategory)) { - _proxy.AddLabel(Settings.TvCategory, Settings); + _proxy.AddLabel(Settings.MusicCategory, Settings); labels = _proxy.GetAvailableLabels(Settings); - if (!labels.Contains(Settings.TvCategory)) + if (!labels.Contains(Settings.MusicCategory)) { return new NzbDroneValidationFailure("TvCategory", "Configuration of label failed") { diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs index fa0962c29..e67e2fe59 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs @@ -12,7 +12,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge RuleFor(c => c.Host).ValidHost(); RuleFor(c => c.Port).InclusiveBetween(1, 65535); - RuleFor(c => c.TvCategory).Matches("^[-a-z]*$").WithMessage("Allowed characters a-z and -"); + RuleFor(c => c.MusicCategory).Matches("^[-a-z]*$").WithMessage("Allowed characters a-z and -"); } } @@ -25,7 +25,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge Host = "localhost"; Port = 8112; Password = "deluge"; - TvCategory = "lidarr"; + MusicCategory = "lidarr"; } [FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)] @@ -41,7 +41,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge public string Password { get; set; } [FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")] - public string TvCategory { get; set; } + public string MusicCategory { get; set; } [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(DelugePriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")] public int RecentTvPriority { get; set; } diff --git a/src/NzbDrone.Core/Download/Clients/DownloadStation/DownloadStationSettings.cs b/src/NzbDrone.Core/Download/Clients/DownloadStation/DownloadStationSettings.cs index 4b8bfc3b5..627589d73 100644 --- a/src/NzbDrone.Core/Download/Clients/DownloadStation/DownloadStationSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/DownloadStation/DownloadStationSettings.cs @@ -1,4 +1,4 @@ -using System.Text.RegularExpressions; +using System.Text.RegularExpressions; using FluentValidation; using NzbDrone.Common.Extensions; using NzbDrone.Core.Annotations; @@ -18,9 +18,9 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation .When(c => c.TvDirectory.IsNotNullOrWhiteSpace()) .WithMessage("Cannot start with /"); - RuleFor(c => c.TvCategory).Matches(@"^\.?[-a-z]*$", RegexOptions.IgnoreCase).WithMessage("Allowed characters a-z and -"); + RuleFor(c => c.MusicCategory).Matches(@"^\.?[-a-z]*$", RegexOptions.IgnoreCase).WithMessage("Allowed characters a-z and -"); - RuleFor(c => c.TvCategory).Empty() + RuleFor(c => c.MusicCategory).Empty() .When(c => c.TvDirectory.IsNotNullOrWhiteSpace()) .WithMessage("Cannot use Category and Directory"); } @@ -43,7 +43,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation public string Password { get; set; } [FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional. Creates a [category] subdirectory in the output directory.")] - public string TvCategory { get; set; } + public string MusicCategory { get; set; } [FieldDefinition(5, Label = "Directory", Type = FieldType.Textbox, HelpText = "Optional shared folder to put downloads into, leave blank to use the default Download Station location")] public string TvDirectory { get; set; } diff --git a/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs b/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs index cf217cb09..e0103cf71 100644 --- a/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs +++ b/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs @@ -70,10 +70,10 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation continue; } } - else if (Settings.TvCategory.IsNotNullOrWhiteSpace()) + else if (Settings.MusicCategory.IsNotNullOrWhiteSpace()) { var directories = outputPath.FullPath.Split('\\', '/'); - if (!directories.Contains(Settings.TvCategory)) + if (!directories.Contains(Settings.MusicCategory)) { continue; } @@ -81,7 +81,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation var item = new DownloadClientItem() { - Category = Settings.TvCategory, + Category = Settings.MusicCategory, DownloadClient = Definition.Name, DownloadId = CreateDownloadId(torrent.Id, serialNumber), Title = torrent.Title, @@ -297,7 +297,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation if (downloadDir != null) { var sharedFolder = downloadDir.Split('\\', '/')[0]; - var fieldName = Settings.TvDirectory.IsNotNullOrWhiteSpace() ? nameof(Settings.TvDirectory) : nameof(Settings.TvCategory); + var fieldName = Settings.TvDirectory.IsNotNullOrWhiteSpace() ? nameof(Settings.TvDirectory) : nameof(Settings.MusicCategory); var folderInfo = _fileStationProxy.GetInfoFileOrDirectory($"/{downloadDir}", Settings); @@ -418,11 +418,11 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation { return Settings.TvDirectory.TrimStart('/'); } - else if (Settings.TvCategory.IsNotNullOrWhiteSpace()) + else if (Settings.MusicCategory.IsNotNullOrWhiteSpace()) { var destDir = GetDefaultDir(); - return $"{destDir.TrimEnd('/')}/{Settings.TvCategory}"; + return $"{destDir.TrimEnd('/')}/{Settings.MusicCategory}"; } return null; diff --git a/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs b/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs index e92741bed..62b018351 100644 --- a/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs +++ b/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs @@ -81,10 +81,10 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation continue; } } - else if (Settings.TvCategory.IsNotNullOrWhiteSpace()) + else if (Settings.MusicCategory.IsNotNullOrWhiteSpace()) { var directories = outputPath.FullPath.Split('\\', '/'); - if (!directories.Contains(Settings.TvCategory)) + if (!directories.Contains(Settings.MusicCategory)) { continue; } @@ -92,7 +92,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation var item = new DownloadClientItem() { - Category = Settings.TvCategory, + Category = Settings.MusicCategory, DownloadClient = Definition.Name, DownloadId = CreateDownloadId(nzb.Id, serialNumber), Title = nzb.Title, @@ -210,7 +210,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation if (downloadDir != null) { var sharedFolder = downloadDir.Split('\\', '/')[0]; - var fieldName = Settings.TvDirectory.IsNotNullOrWhiteSpace() ? nameof(Settings.TvDirectory) : nameof(Settings.TvCategory); + var fieldName = Settings.TvDirectory.IsNotNullOrWhiteSpace() ? nameof(Settings.TvDirectory) : nameof(Settings.MusicCategory); var folderInfo = _fileStationProxy.GetInfoFileOrDirectory($"/{downloadDir}", Settings); @@ -409,11 +409,11 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation { return Settings.TvDirectory.TrimStart('/'); } - else if (Settings.TvCategory.IsNotNullOrWhiteSpace()) + else if (Settings.MusicCategory.IsNotNullOrWhiteSpace()) { var destDir = GetDefaultDir(); - return $"{destDir.TrimEnd('/')}/{Settings.TvCategory}"; + return $"{destDir.TrimEnd('/')}/{Settings.MusicCategory}"; } return null; diff --git a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs index 064b04d10..8431f8ec0 100644 --- a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs +++ b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs @@ -204,11 +204,11 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex private ValidationFailure TestCategory() { - var group = GetGroups().FirstOrDefault(c => c.GroupName == Settings.TvCategory); + var group = GetGroups().FirstOrDefault(c => c.GroupName == Settings.MusicCategory); if (group == null) { - if (Settings.TvCategory.IsNotNullOrWhiteSpace()) + if (Settings.MusicCategory.IsNotNullOrWhiteSpace()) { return new NzbDroneValidationFailure("TvCategory", "Group does not exist") { diff --git a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexProxy.cs b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexProxy.cs index c93d18b57..f8249ba32 100644 --- a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexProxy.cs @@ -43,9 +43,9 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex .Post() .AddQueryParam("priority", priority.ToString()); - if (settings.TvCategory.IsNotNullOrWhiteSpace()) + if (settings.MusicCategory.IsNotNullOrWhiteSpace()) { - requestBuilder.AddQueryParam("groupname", settings.TvCategory); + requestBuilder.AddQueryParam("groupname", settings.MusicCategory); } requestBuilder.AddFormUpload("name", filename, nzbData, "application/x-nzb"); @@ -93,9 +93,9 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex var requestBuilder = BuildRequest(settings).Resource("nzb"); - if (settings.TvCategory.IsNotNullOrWhiteSpace()) + if (settings.MusicCategory.IsNotNullOrWhiteSpace()) { - requestBuilder.AddQueryParam("groupName", settings.TvCategory); + requestBuilder.AddQueryParam("groupName", settings.MusicCategory); } requestBuilder.AddQueryParam("limitDone", doneLimit.ToString()); diff --git a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexSettings.cs b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexSettings.cs index b4e22fe91..513b165f2 100644 --- a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexSettings.cs @@ -1,4 +1,4 @@ -using FluentValidation; +using FluentValidation; using NzbDrone.Core.Annotations; using NzbDrone.Core.ThingiProvider; using NzbDrone.Core.Validation; @@ -15,7 +15,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex RuleFor(c => c.ApiKey).NotEmpty() .WithMessage("API Key is required"); - RuleFor(c => c.TvCategory).NotEmpty() + RuleFor(c => c.MusicCategory).NotEmpty() .WithMessage("A category is recommended") .AsWarning(); } @@ -29,7 +29,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex { Host = "localhost"; Port = 4321; - TvCategory = "Music"; + MusicCategory = "Music"; RecentTvPriority = (int)NzbVortexPriority.Normal; OlderTvPriority = (int)NzbVortexPriority.Normal; } @@ -44,7 +44,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex public string ApiKey { get; set; } [FieldDefinition(3, Label = "Group", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")] - public string TvCategory { get; set; } + public string MusicCategory { get; set; } [FieldDefinition(4, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(NzbVortexPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")] public int RecentTvPriority { get; set; } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs index 9229bafe0..576205de1 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs @@ -35,7 +35,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget protected override string AddFromNzbFile(RemoteAlbum remoteAlbum, string filename, byte[] fileContent) { - var category = Settings.TvCategory; + var category = Settings.MusicCategory; var priority = remoteAlbum.IsRecentAlbum() ? Settings.RecentTvPriority : Settings.OlderTvPriority; @@ -182,7 +182,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget public override IEnumerable GetItems() { - return GetQueue().Concat(GetHistory()).Where(downloadClientItem => downloadClientItem.Category == Settings.TvCategory); + return GetQueue().Concat(GetHistory()).Where(downloadClientItem => downloadClientItem.Category == Settings.MusicCategory); } public override void RemoveItem(string downloadId, bool deleteData) @@ -199,7 +199,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget { var config = _proxy.GetConfig(Settings); - var category = GetCategories(config).FirstOrDefault(v => v.Name == Settings.TvCategory); + var category = GetCategories(config).FirstOrDefault(v => v.Name == Settings.MusicCategory); var status = new DownloadClientInfo { @@ -282,7 +282,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget var config = _proxy.GetConfig(Settings); var categories = GetCategories(config); - if (!Settings.TvCategory.IsNullOrWhiteSpace() && !categories.Any(v => v.Name == Settings.TvCategory)) + if (!Settings.MusicCategory.IsNullOrWhiteSpace() && !categories.Any(v => v.Name == Settings.MusicCategory)) { return new NzbDroneValidationFailure("TvCategory", "Category does not exist") { diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetSettings.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetSettings.cs index acaab3f4b..ea211d2c5 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetSettings.cs @@ -14,7 +14,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget RuleFor(c => c.Username).NotEmpty().When(c => !string.IsNullOrWhiteSpace(c.Password)); RuleFor(c => c.Password).NotEmpty().When(c => !string.IsNullOrWhiteSpace(c.Username)); - RuleFor(c => c.TvCategory).NotEmpty().WithMessage("A category is recommended").AsWarning(); + RuleFor(c => c.MusicCategory).NotEmpty().WithMessage("A category is recommended").AsWarning(); } } @@ -26,7 +26,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget { Host = "localhost"; Port = 6789; - TvCategory = "Music"; + MusicCategory = "Music"; Username = "nzbget"; Password = "tegbzn6789"; RecentTvPriority = (int)NzbgetPriority.Normal; @@ -46,7 +46,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget public string Password { get; set; } [FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")] - public string TvCategory { get; set; } + public string MusicCategory { get; set; } [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(NzbgetPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")] public int RecentTvPriority { get; set; } diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs index 1f0985162..b006ef5db 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs @@ -35,9 +35,9 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent { _proxy.AddTorrentFromUrl(magnetLink, Settings); - if (Settings.TvCategory.IsNotNullOrWhiteSpace()) + if (Settings.MusicCategory.IsNotNullOrWhiteSpace()) { - _proxy.SetTorrentLabel(hash.ToLower(), Settings.TvCategory, Settings); + _proxy.SetTorrentLabel(hash.ToLower(), Settings.MusicCategory, Settings); } var isRecentEpisode = remoteAlbum.IsRecentAlbum(); @@ -59,9 +59,9 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent try { - if (Settings.TvCategory.IsNotNullOrWhiteSpace()) + if (Settings.MusicCategory.IsNotNullOrWhiteSpace()) { - _proxy.SetTorrentLabel(hash.ToLower(), Settings.TvCategory, Settings); + _proxy.SetTorrentLabel(hash.ToLower(), Settings.MusicCategory, Settings); } } catch (Exception ex) @@ -204,7 +204,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent else if (version < 6) { // API version 6 introduced support for labels - if (Settings.TvCategory.IsNotNullOrWhiteSpace()) + if (Settings.MusicCategory.IsNotNullOrWhiteSpace()) { return new NzbDroneValidationFailure("Category", "Category is not supported") { @@ -212,7 +212,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent }; } } - else if (Settings.TvCategory.IsNullOrWhiteSpace()) + else if (Settings.MusicCategory.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 dbd015f20..70008559f 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxy.cs @@ -61,8 +61,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.MusicCategory) + .AddQueryParam("category", settings.MusicCategory); var response = ProcessRequest>(request, settings); @@ -75,9 +75,9 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent .Post() .AddFormParameter("urls", torrentUrl); - if (settings.TvCategory.IsNotNullOrWhiteSpace()) + if (settings.MusicCategory.IsNotNullOrWhiteSpace()) { - request.AddFormParameter("category", settings.TvCategory); + request.AddFormParameter("category", settings.MusicCategory); } var result = ProcessRequest(request, settings); @@ -110,9 +110,9 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent .Post() .AddFormParameter("hashes", hash); - if (settings.TvCategory.IsNotNullOrWhiteSpace()) + if (settings.MusicCategory.IsNotNullOrWhiteSpace()) { - request.AddFormParameter("category", settings.TvCategory); + request.AddFormParameter("category", settings.MusicCategory); } ProcessRequest(request, settings); diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentSettings.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentSettings.cs index 27be15c12..bee84f902 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 = 8080; - TvCategory = "lidarr"; + MusicCategory = "lidarr"; } [FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)] @@ -38,7 +38,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent public string Password { get; set; } [FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")] - public string TvCategory { get; set; } + public string MusicCategory { get; set; } [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(QBittorrentPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")] public int RecentTvPriority { get; set; } diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs index 3ae3674d2..e074f7f55 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs @@ -35,7 +35,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd protected override string AddFromNzbFile(RemoteAlbum remoteAlbum, string filename, byte[] fileContent) { - var category = Settings.TvCategory; + var category = Settings.MusicCategory; var priority = remoteAlbum.IsRecentAlbum() ? Settings.RecentTvPriority : Settings.OlderTvPriority; var response = _proxy.DownloadNzb(fileContent, filename, category, priority, Settings); @@ -114,7 +114,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd private IEnumerable GetHistory() { - var sabHistory = _proxy.GetHistory(0, _configService.DownloadClientHistoryLimit, Settings.TvCategory, Settings); + var sabHistory = _proxy.GetHistory(0, _configService.DownloadClientHistoryLimit, Settings.MusicCategory, Settings); var historyItems = new List(); @@ -192,7 +192,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd { foreach (var downloadClientItem in GetQueue().Concat(GetHistory())) { - if (downloadClientItem.Category == Settings.TvCategory || downloadClientItem.Category == "*" && Settings.TvCategory.IsNullOrWhiteSpace()) + if (downloadClientItem.Category == Settings.MusicCategory || downloadClientItem.Category == "*" && Settings.MusicCategory.IsNullOrWhiteSpace()) { yield return downloadClientItem; } @@ -246,7 +246,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd var config = _proxy.GetConfig(Settings); var categories = GetCategories(config).ToArray(); - var category = categories.FirstOrDefault(v => v.Name == Settings.TvCategory); + var category = categories.FirstOrDefault(v => v.Name == Settings.MusicCategory); if (category == null) { @@ -429,7 +429,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd private ValidationFailure TestCategory() { var config = _proxy.GetConfig(Settings); - var category = GetCategories(config).FirstOrDefault((SabnzbdCategory v) => v.Name == Settings.TvCategory); + var category = GetCategories(config).FirstOrDefault((SabnzbdCategory v) => v.Name == Settings.MusicCategory); if (category != null) { @@ -444,7 +444,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd } else { - if (!Settings.TvCategory.IsNullOrWhiteSpace()) + if (!Settings.MusicCategory.IsNullOrWhiteSpace()) { return new NzbDroneValidationFailure("TvCategory", "Category does not exist") { @@ -453,7 +453,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd }; } } - if (config.Misc.enable_tv_sorting && ContainsCategory(config.Misc.tv_categories, Settings.TvCategory)) + if (config.Misc.enable_tv_sorting && ContainsCategory(config.Misc.tv_categories, Settings.MusicCategory)) { return new NzbDroneValidationFailure("TvCategory", "Disable TV Sorting") { @@ -461,7 +461,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd DetailedDescription = "You must disable Sabnzbd TV Sorting for the category Lidarr uses to prevent import issues. Go to Sabnzbd to fix it." }; } - if (config.Misc.enable_movie_sorting && ContainsCategory(config.Misc.movie_categories, Settings.TvCategory)) + if (config.Misc.enable_movie_sorting && ContainsCategory(config.Misc.movie_categories, Settings.MusicCategory)) { return new NzbDroneValidationFailure("TvCategory", "Disable Movie Sorting") { @@ -469,7 +469,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd DetailedDescription = "You must disable Sabnzbd Movie Sorting for the category Lidarr uses to prevent import issues. Go to Sabnzbd to fix it." }; } - if (config.Misc.enable_date_sorting && ContainsCategory(config.Misc.date_categories, Settings.TvCategory)) + if (config.Misc.enable_date_sorting && ContainsCategory(config.Misc.date_categories, Settings.MusicCategory)) { return new NzbDroneValidationFailure("TvCategory", "Disable Date Sorting") { diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs index ce86d3773..b062eeda8 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs @@ -1,4 +1,4 @@ -using FluentValidation; +using FluentValidation; using NzbDrone.Core.Annotations; using NzbDrone.Core.ThingiProvider; using NzbDrone.Core.Validation; @@ -24,7 +24,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd .WithMessage("Password is required when API key is not configured") .When(c => string.IsNullOrWhiteSpace(c.ApiKey)); - RuleFor(c => c.TvCategory).NotEmpty() + RuleFor(c => c.MusicCategory).NotEmpty() .WithMessage("A category is recommended") .AsWarning(); } @@ -38,7 +38,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd { Host = "localhost"; Port = 8080; - TvCategory = "music"; + MusicCategory = "music"; RecentTvPriority = (int)SabnzbdPriority.Default; OlderTvPriority = (int)SabnzbdPriority.Default; } @@ -59,7 +59,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd public string Password { get; set; } [FieldDefinition(5, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")] - public string TvCategory { get; set; } + public string MusicCategory { get; set; } [FieldDefinition(6, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(SabnzbdPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")] public int RecentTvPriority { get; set; } diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs index 72dfa4913..b05f073dc 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs @@ -48,17 +48,17 @@ namespace NzbDrone.Core.Download.Clients.Transmission { if (!new OsPath(Settings.TvDirectory).Contains(outputPath)) continue; } - else if (Settings.TvCategory.IsNotNullOrWhiteSpace()) + else if (Settings.MusicCategory.IsNotNullOrWhiteSpace()) { var directories = outputPath.FullPath.Split('\\', '/'); - if (!directories.Contains(Settings.TvCategory)) continue; + if (!directories.Contains(Settings.MusicCategory)) continue; } outputPath = _remotePathMappingService.RemapRemoteToLocal(Settings.Host, outputPath); var item = new DownloadClientItem(); item.DownloadId = torrent.HashString.ToUpper(); - item.Category = Settings.TvCategory; + item.Category = Settings.MusicCategory; item.Title = torrent.Name; item.DownloadClient = Definition.Name; @@ -114,9 +114,9 @@ namespace NzbDrone.Core.Download.Clients.Transmission var config = _proxy.GetConfig(Settings); var destDir = config.GetValueOrDefault("download-dir") as string; - if (Settings.TvCategory.IsNotNullOrWhiteSpace()) + if (Settings.MusicCategory.IsNotNullOrWhiteSpace()) { - destDir = string.Format("{0}/.{1}", destDir, Settings.TvCategory); + destDir = string.Format("{0}/.{1}", destDir, Settings.MusicCategory); } return new DownloadClientInfo @@ -174,12 +174,12 @@ namespace NzbDrone.Core.Download.Clients.Transmission { return Settings.TvDirectory; } - else if (Settings.TvCategory.IsNotNullOrWhiteSpace()) + else if (Settings.MusicCategory.IsNotNullOrWhiteSpace()) { var config = _proxy.GetConfig(Settings); var destDir = (string)config.GetValueOrDefault("download-dir"); - return string.Format("{0}/{1}", destDir.TrimEnd('/'), Settings.TvCategory); + return string.Format("{0}/{1}", destDir.TrimEnd('/'), Settings.MusicCategory); } else { diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs index 0437d5a27..e456bbd30 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs @@ -16,9 +16,9 @@ namespace NzbDrone.Core.Download.Clients.Transmission RuleFor(c => c.UrlBase).ValidUrlBase(); - RuleFor(c => c.TvCategory).Matches(@"^\.?[-a-z]*$", RegexOptions.IgnoreCase).WithMessage("Allowed characters a-z and -"); + RuleFor(c => c.MusicCategory).Matches(@"^\.?[-a-z]*$", RegexOptions.IgnoreCase).WithMessage("Allowed characters a-z and -"); - RuleFor(c => c.TvCategory).Empty() + RuleFor(c => c.MusicCategory).Empty() .When(c => c.TvDirectory.IsNotNullOrWhiteSpace()) .WithMessage("Cannot use Category and Directory"); } @@ -51,7 +51,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission public string Password { get; set; } [FieldDefinition(5, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional. Creates a [category] subdirectory in the output directory.")] - public string TvCategory { get; set; } + public string MusicCategory { get; set; } [FieldDefinition(6, Label = "Directory", Type = FieldType.Textbox, Advanced = true, HelpText = "Optional location to put downloads in, leave blank to use the default Transmission location")] public string TvDirectory { get; set; } diff --git a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs index 00ffd0ec6..cf0b064bc 100644 --- a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs @@ -41,7 +41,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent { var priority = (RTorrentPriority)(remoteAlbum.IsRecentAlbum() ? Settings.RecentTvPriority : Settings.OlderTvPriority); - _proxy.AddTorrentFromUrl(magnetLink, Settings.TvCategory, priority, Settings.TvDirectory, Settings); + _proxy.AddTorrentFromUrl(magnetLink, Settings.MusicCategory, priority, Settings.TvDirectory, Settings); var tries = 10; var retryDelay = 500; @@ -61,7 +61,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent { var priority = (RTorrentPriority)(remoteEpisode.IsRecentAlbum() ? Settings.RecentTvPriority : Settings.OlderTvPriority); - _proxy.AddTorrentFromFile(filename, fileContent, Settings.TvCategory, priority, Settings.TvDirectory, Settings); + _proxy.AddTorrentFromFile(filename, fileContent, Settings.MusicCategory, priority, Settings.TvDirectory, Settings); var tries = 10; var retryDelay = 500; @@ -89,7 +89,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent foreach (RTorrentTorrent torrent in torrents) { // Don't concern ourselves with categories other than specified - if (torrent.Category != Settings.TvCategory) continue; + if (torrent.Category != Settings.MusicCategory) continue; if (torrent.Path.StartsWith(".")) { diff --git a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentSettings.cs b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentSettings.cs index 07a5c9b6f..c309a10eb 100644 --- a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentSettings.cs @@ -1,4 +1,4 @@ -using FluentValidation; +using FluentValidation; using NzbDrone.Core.Annotations; using NzbDrone.Core.ThingiProvider; using NzbDrone.Core.Validation; @@ -11,7 +11,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent { RuleFor(c => c.Host).ValidHost(); RuleFor(c => c.Port).InclusiveBetween(1, 65535); - RuleFor(c => c.TvCategory).NotEmpty() + RuleFor(c => c.MusicCategory).NotEmpty() .WithMessage("A category is recommended") .AsWarning(); } @@ -26,7 +26,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent Host = "localhost"; Port = 8080; UrlBase = "RPC2"; - TvCategory = "lidarr"; + MusicCategory = "lidarr"; OlderTvPriority = (int)RTorrentPriority.Normal; RecentTvPriority = (int)RTorrentPriority.Normal; } @@ -50,7 +50,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent public string Password { get; set; } [FieldDefinition(6, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional.")] - public string TvCategory { get; set; } + public string MusicCategory { get; set; } [FieldDefinition(7, Label = "Directory", Type = FieldType.Textbox, Advanced = true, HelpText = "Optional location to put downloads in, leave blank to use the default rTorrent location")] public string TvDirectory { get; set; } diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs index d82178e81..39fddc8b0 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs @@ -39,7 +39,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent protected override string AddFromMagnetLink(RemoteAlbum remoteAlbum, string hash, string magnetLink) { _proxy.AddTorrentFromUrl(magnetLink, Settings); - _proxy.SetTorrentLabel(hash, Settings.TvCategory, Settings); + _proxy.SetTorrentLabel(hash, Settings.MusicCategory, Settings); var isRecentEpisode = remoteAlbum.IsRecentAlbum(); @@ -57,7 +57,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent protected override string AddFromTorrentFile(RemoteAlbum remoteAlbum, string hash, string filename, byte[] fileContent) { _proxy.AddTorrentFromFile(filename, fileContent, Settings); - _proxy.SetTorrentLabel(hash, Settings.TvCategory, Settings); + _proxy.SetTorrentLabel(hash, Settings.MusicCategory, Settings); var isRecentEpisode = remoteAlbum.IsRecentAlbum(); @@ -82,7 +82,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent foreach (var torrent in torrents) { - if (torrent.Label != Settings.TvCategory) + if (torrent.Label != Settings.MusicCategory) { continue; } @@ -146,7 +146,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent { List torrents; - var cacheKey = string.Format("{0}:{1}:{2}", Settings.Host, Settings.Port, Settings.TvCategory); + var cacheKey = string.Format("{0}:{1}:{2}", Settings.Host, Settings.Port, Settings.MusicCategory); var cache = _torrentCache.Find(cacheKey); var response = _proxy.GetTorrents(cache == null ? null : cache.CacheID, Settings); @@ -198,7 +198,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent if (config.GetValueOrDefault("dir_add_label") == "true") { - destDir = destDir + Settings.TvCategory; + destDir = destDir + Settings.MusicCategory; } } diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentSettings.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentSettings.cs index cd03090f4..ca487caed 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentSettings.cs @@ -11,7 +11,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent { RuleFor(c => c.Host).ValidHost(); RuleFor(c => c.Port).InclusiveBetween(1, 65535); - RuleFor(c => c.TvCategory).NotEmpty(); + RuleFor(c => c.MusicCategory).NotEmpty(); } } @@ -23,7 +23,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent { Host = "localhost"; Port = 8080; - TvCategory = "lidarr"; + MusicCategory = "lidarr"; } [FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)] @@ -39,7 +39,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent public string Password { get; set; } [FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")] - public string TvCategory { get; set; } + public string MusicCategory { get; set; } [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(UTorrentPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")] public int RecentTvPriority { get; set; }