mirror of https://github.com/Sonarr/Sonarr
Add paused options for Deluge and Transmission
New: Option to add paused for Deluge New: Option to add paused for Transmission Closes #795
This commit is contained in:
parent
8e8da76467
commit
5663eb527b
|
@ -40,8 +40,6 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
||||||
_proxy.SetLabel(actualHash, Settings.TvCategory, Settings);
|
_proxy.SetLabel(actualHash, Settings.TvCategory, Settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
_proxy.SetTorrentConfiguration(actualHash, "remove_at_ratio", false, Settings);
|
|
||||||
|
|
||||||
var isRecentEpisode = remoteEpisode.IsRecentEpisode();
|
var isRecentEpisode = remoteEpisode.IsRecentEpisode();
|
||||||
|
|
||||||
if (isRecentEpisode && Settings.RecentTvPriority == (int)DelugePriority.First ||
|
if (isRecentEpisode && Settings.RecentTvPriority == (int)DelugePriority.First ||
|
||||||
|
@ -67,8 +65,6 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
||||||
_proxy.SetLabel(actualHash, Settings.TvCategory, Settings);
|
_proxy.SetLabel(actualHash, Settings.TvCategory, Settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
_proxy.SetTorrentConfiguration(actualHash, "remove_at_ratio", false, Settings);
|
|
||||||
|
|
||||||
var isRecentEpisode = remoteEpisode.IsRecentEpisode();
|
var isRecentEpisode = remoteEpisode.IsRecentEpisode();
|
||||||
|
|
||||||
if (isRecentEpisode && Settings.RecentTvPriority == (int)DelugePriority.First ||
|
if (isRecentEpisode && Settings.RecentTvPriority == (int)DelugePriority.First ||
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
@ -84,21 +84,33 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
||||||
|
|
||||||
public string AddTorrentFromMagnet(string magnetLink, DelugeSettings settings)
|
public string AddTorrentFromMagnet(string magnetLink, DelugeSettings settings)
|
||||||
{
|
{
|
||||||
var response = ProcessRequest<string>(settings, "core.add_torrent_magnet", magnetLink, new JObject());
|
var options = new
|
||||||
|
{
|
||||||
|
add_paused = settings.AddPaused,
|
||||||
|
remove_at_ratio = false
|
||||||
|
};
|
||||||
|
|
||||||
|
var response = ProcessRequest<string>(settings, "core.add_torrent_magnet", magnetLink, options);
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string AddTorrentFromFile(string filename, byte[] fileContent, DelugeSettings settings)
|
public string AddTorrentFromFile(string filename, byte[] fileContent, DelugeSettings settings)
|
||||||
{
|
{
|
||||||
var response = ProcessRequest<string>(settings, "core.add_torrent_file", filename, fileContent, new JObject());
|
var options = new
|
||||||
|
{
|
||||||
|
add_paused = settings.AddPaused,
|
||||||
|
remove_at_ratio = false
|
||||||
|
};
|
||||||
|
|
||||||
|
var response = ProcessRequest<string>(settings, "core.add_torrent_file", filename, fileContent, options);
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool RemoveTorrent(string hashString, bool removeData, DelugeSettings settings)
|
public bool RemoveTorrent(string hash, bool removeData, DelugeSettings settings)
|
||||||
{
|
{
|
||||||
var response = ProcessRequest<bool>(settings, "core.remove_torrent", hashString, removeData);
|
var response = ProcessRequest<bool>(settings, "core.remove_torrent", hash, removeData);
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using NzbDrone.Core.Annotations;
|
using NzbDrone.Core.Annotations;
|
||||||
using NzbDrone.Core.ThingiProvider;
|
using NzbDrone.Core.ThingiProvider;
|
||||||
using NzbDrone.Core.Validation;
|
using NzbDrone.Core.Validation;
|
||||||
|
@ -49,7 +49,10 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
||||||
[FieldDefinition(6, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(DelugePriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")]
|
[FieldDefinition(6, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(DelugePriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")]
|
||||||
public int OlderTvPriority { get; set; }
|
public int OlderTvPriority { get; set; }
|
||||||
|
|
||||||
[FieldDefinition(7, Label = "Use SSL", Type = FieldType.Checkbox)]
|
[FieldDefinition(7, Label = "Add Paused", Type = FieldType.Checkbox)]
|
||||||
|
public bool AddPaused { get; set; }
|
||||||
|
|
||||||
|
[FieldDefinition(8, Label = "Use SSL", Type = FieldType.Checkbox)]
|
||||||
public bool UseSsl { get; set; }
|
public bool UseSsl { get; set; }
|
||||||
|
|
||||||
public NzbDroneValidationResult Validate()
|
public NzbDroneValidationResult Validate()
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
|
@ -51,6 +51,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
|
||||||
{
|
{
|
||||||
var arguments = new Dictionary<string, object>();
|
var arguments = new Dictionary<string, object>();
|
||||||
arguments.Add("filename", torrentUrl);
|
arguments.Add("filename", torrentUrl);
|
||||||
|
arguments.Add("paused", settings.AddPaused);
|
||||||
|
|
||||||
if (!downloadDirectory.IsNullOrWhiteSpace())
|
if (!downloadDirectory.IsNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
|
@ -64,6 +65,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
|
||||||
{
|
{
|
||||||
var arguments = new Dictionary<string, object>();
|
var arguments = new Dictionary<string, object>();
|
||||||
arguments.Add("metainfo", Convert.ToBase64String(torrentData));
|
arguments.Add("metainfo", Convert.ToBase64String(torrentData));
|
||||||
|
arguments.Add("paused", settings.AddPaused);
|
||||||
|
|
||||||
if (!downloadDirectory.IsNullOrWhiteSpace())
|
if (!downloadDirectory.IsNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using NzbDrone.Core.Annotations;
|
using NzbDrone.Core.Annotations;
|
||||||
using NzbDrone.Core.ThingiProvider;
|
using NzbDrone.Core.ThingiProvider;
|
||||||
|
@ -62,7 +62,10 @@ namespace NzbDrone.Core.Download.Clients.Transmission
|
||||||
[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 episodes that aired over 14 days ago")]
|
||||||
public int OlderTvPriority { get; set; }
|
public int OlderTvPriority { get; set; }
|
||||||
|
|
||||||
[FieldDefinition(9, Label = "Use SSL", Type = FieldType.Checkbox)]
|
[FieldDefinition(9, Label = "Add Paused", Type = FieldType.Checkbox)]
|
||||||
|
public bool AddPaused { get; set; }
|
||||||
|
|
||||||
|
[FieldDefinition(10, Label = "Use SSL", Type = FieldType.Checkbox)]
|
||||||
public bool UseSsl { get; set; }
|
public bool UseSsl { get; set; }
|
||||||
|
|
||||||
public NzbDroneValidationResult Validate()
|
public NzbDroneValidationResult Validate()
|
||||||
|
|
Loading…
Reference in New Issue