mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
Added: "Add Paused" option to Deluge and Transmission (#3038)
This commit is contained in:
parent
c566c6e18a
commit
75b486c6c8
@ -42,8 +42,6 @@ protected override string AddFromMagnetLink(RemoteMovie remoteMovie, string hash
|
||||
_proxy.SetLabel(actualHash, Settings.MovieCategory, Settings);
|
||||
}
|
||||
|
||||
_proxy.SetTorrentConfiguration(actualHash, "remove_at_ratio", false, Settings);
|
||||
|
||||
var isRecentMovie = remoteMovie.Movie.IsRecentMovie;
|
||||
|
||||
if (isRecentMovie && Settings.RecentMoviePriority == (int)DelugePriority.First ||
|
||||
@ -64,8 +62,6 @@ protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string has
|
||||
_proxy.SetLabel(actualHash, Settings.MovieCategory, Settings);
|
||||
}
|
||||
|
||||
_proxy.SetTorrentConfiguration(actualHash, "remove_at_ratio", false, Settings);
|
||||
|
||||
var isRecentMovie = remoteMovie.Movie.IsRecentMovie;
|
||||
|
||||
if (isRecentMovie && Settings.RecentMoviePriority == (int)DelugePriority.First ||
|
||||
|
@ -84,21 +84,31 @@ public DelugeTorrent[] GetTorrentsByLabel(string label, 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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -49,7 +49,10 @@ public DelugeSettings()
|
||||
[FieldDefinition(6, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(DelugePriority), HelpText = "Priority to use when grabbing movies that released over 21 days ago")]
|
||||
public int OlderMoviePriority { 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 NzbDroneValidationResult Validate()
|
||||
|
@ -51,6 +51,7 @@ public void AddTorrentFromUrl(string torrentUrl, string downloadDirectory, Trans
|
||||
{
|
||||
var arguments = new Dictionary<string, object>();
|
||||
arguments.Add("filename", torrentUrl);
|
||||
arguments.Add("paused", settings.AddPaused);
|
||||
|
||||
if (!downloadDirectory.IsNullOrWhiteSpace())
|
||||
{
|
||||
@ -64,6 +65,7 @@ public void AddTorrentFromData(byte[] torrentData, string downloadDirectory, Tra
|
||||
{
|
||||
var arguments = new Dictionary<string, object>();
|
||||
arguments.Add("metainfo", Convert.ToBase64String(torrentData));
|
||||
arguments.Add("paused", settings.AddPaused);
|
||||
|
||||
if (!downloadDirectory.IsNullOrWhiteSpace())
|
||||
{
|
||||
|
@ -63,7 +63,10 @@ public TransmissionSettings()
|
||||
[FieldDefinition(8, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(TransmissionPriority), HelpText = "Priority to use when grabbing movies that released over 21 days ago")]
|
||||
public int OlderMoviePriority { 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 NzbDroneValidationResult Validate()
|
||||
|
Loading…
Reference in New Issue
Block a user