From 41dda3af483db5b82dc1b2afd9942874fd386da8 Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Sat, 14 Jan 2017 11:50:18 +0100 Subject: [PATCH] Update uTorrent to be able to use it as download client. --- .../Download/Clients/uTorrent/UTorrent.cs | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs index da942b7f1..171910744 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs @@ -68,6 +68,38 @@ protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string return hash; } + protected override string AddFromMagnetLink(RemoteMovie 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; + } + + protected override string AddFromTorrentFile(RemoteMovie 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; + } + public override string Name => "uTorrent"; public override IEnumerable GetItems()