From df69c58d2b9900c4c363431eef5b17d8f7802132 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Tue, 10 Jan 2017 17:37:23 -0500 Subject: [PATCH] Fix transmission --- .../Clients/Transmission/TransmissionBase.cs | 25 +++++++++++++++++++ .../Transmission/TransmissionSettings.cs | 4 +-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs index 8358e9e79..da62e6bcb 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs @@ -165,6 +165,31 @@ namespace NzbDrone.Core.Download.Clients.Transmission return hash; } + protected override string AddFromMagnetLink(RemoteMovie remoteMovie, string hash, string magnetLink) + { + _proxy.AddTorrentFromUrl(magnetLink, GetDownloadDirectory(), Settings); + if (remoteMovie.Release.Age < 14 && Settings.RecentTvPriority == (int)TransmissionPriority.First || + remoteMovie.Release.Age > 14 && Settings.OlderTvPriority == (int)TransmissionPriority.First) + { + _proxy.MoveTorrentToTopInQueue(hash, Settings); + } + + return hash; + } + + protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string hash, string filename, byte[] fileContent) + { + _proxy.AddTorrentFromData(fileContent, GetDownloadDirectory(), Settings); + + if (remoteMovie.Release.Age < 14 && Settings.RecentTvPriority == (int)TransmissionPriority.First || + remoteMovie.Release.Age > 14 && Settings.OlderTvPriority == (int)TransmissionPriority.First) + { + _proxy.MoveTorrentToTopInQueue(hash, Settings); + } + + return hash; + } + protected override void Test(List failures) { failures.AddIfNotNull(TestConnection()); diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs index 633ee7a57..893705bda 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs @@ -56,10 +56,10 @@ namespace NzbDrone.Core.Download.Clients.Transmission [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; } - [FieldDefinition(7, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(TransmissionPriority), HelpText = "Priority to use when grabbing episodes that aired within the last 14 days")] + [FieldDefinition(7, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(TransmissionPriority), HelpText = "Priority to use when grabbing movies that we're released within the last 14 days")] public int RecentTvPriority { get; set; } - [FieldDefinition(8, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(TransmissionPriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")] + [FieldDefinition(8, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(TransmissionPriority), HelpText = "Priority to use when grabbing movies that we're released over 14 days ago")] public int OlderTvPriority { get; set; } [FieldDefinition(9, Label = "Use SSL", Type = FieldType.Checkbox)]