|
|
|
@ -5,6 +5,7 @@ using System.Net;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using NLog;
|
|
|
|
|
using NzbDrone.Common.Cache;
|
|
|
|
|
using NzbDrone.Common.Extensions;
|
|
|
|
|
using NzbDrone.Common.Http;
|
|
|
|
|
using NzbDrone.Common.Serializer;
|
|
|
|
|
|
|
|
|
@ -102,21 +103,21 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
|
|
|
|
public string AddTorrentFromMagnet(string magnetLink, DelugeSettings settings)
|
|
|
|
|
{
|
|
|
|
|
var options = new
|
|
|
|
|
{
|
|
|
|
|
add_paused = settings.AddPaused,
|
|
|
|
|
remove_at_ratio = false
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (settings.DownloadDirectory.IsNotNullOrWhiteSpace())
|
|
|
|
|
{
|
|
|
|
|
options.download_location = settings.DownloadDirectory;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (settings.CompletedDirectory.IsNotNullOrWhiteSpace())
|
|
|
|
|
{
|
|
|
|
|
options.move_completed_path = settings.CompletedDirectory;
|
|
|
|
|
options.move_completed = true;
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
add_paused = settings.AddPaused,
|
|
|
|
|
remove_at_ratio = false
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (settings.DownloadDirectory.IsNotNullOrWhiteSpace())
|
|
|
|
|
{
|
|
|
|
|
options.download_location = settings.DownloadDirectory;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (settings.CompletedDirectory.IsNotNullOrWhiteSpace())
|
|
|
|
|
{
|
|
|
|
|
options.move_completed_path = settings.CompletedDirectory;
|
|
|
|
|
options.move_completed = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var response = ProcessRequest<string>(settings, "core.add_torrent_magnet", magnetLink, options);
|
|
|
|
|
|
|
|
|
@ -126,21 +127,21 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
|
|
|
|
public string AddTorrentFromFile(string filename, byte[] fileContent, DelugeSettings settings)
|
|
|
|
|
{
|
|
|
|
|
var options = new
|
|
|
|
|
{
|
|
|
|
|
add_paused = settings.AddPaused,
|
|
|
|
|
remove_at_ratio = false
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (settings.DownloadDirectory.IsNotNullOrWhiteSpace())
|
|
|
|
|
{
|
|
|
|
|
options.download_location = settings.DownloadDirectory;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (settings.CompletedDirectory.IsNotNullOrWhiteSpace())
|
|
|
|
|
{
|
|
|
|
|
options.move_completed_path = settings.CompletedDirectory;
|
|
|
|
|
options.move_completed = true;
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
add_paused = settings.AddPaused,
|
|
|
|
|
remove_at_ratio = false
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (settings.DownloadDirectory.IsNotNullOrWhiteSpace())
|
|
|
|
|
{
|
|
|
|
|
options.download_location = settings.DownloadDirectory;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (settings.CompletedDirectory.IsNotNullOrWhiteSpace())
|
|
|
|
|
{
|
|
|
|
|
options.move_completed_path = settings.CompletedDirectory;
|
|
|
|
|
options.move_completed = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var response = ProcessRequest<string>(settings, "core.add_torrent_file", filename, fileContent, options);
|
|
|
|
|
|
|
|
|
|