diff --git a/src/NzbDrone.Core/Download/Clients/Putio/Putio.cs b/src/NzbDrone.Core/Download/Clients/Putio/Putio.cs index f211bf3bd..a2ce8bbea 100644 --- a/src/NzbDrone.Core/Download/Clients/Putio/Putio.cs +++ b/src/NzbDrone.Core/Download/Clients/Putio/Putio.cs @@ -227,5 +227,11 @@ namespace NzbDrone.Core.Download.Clients.Putio { throw new NotImplementedException(); } + + public override void MarkItemAsImported(DownloadClientItem downloadClientItem) + { + // What to do here? Maybe delete the file and transfer from put.io? + base.MarkItemAsImported(downloadClientItem); + } } } diff --git a/src/NzbDrone.Core/Download/Clients/Putio/PutioProxy.cs b/src/NzbDrone.Core/Download/Clients/Putio/PutioProxy.cs index c12878567..2fd3b5685 100644 --- a/src/NzbDrone.Core/Download/Clients/Putio/PutioProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Putio/PutioProxy.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Net; using System.Net.Http; using NLog; +using NzbDrone.Common.Extensions; using NzbDrone.Common.Http; namespace NzbDrone.Core.Download.Clients.Putio @@ -35,9 +36,15 @@ namespace NzbDrone.Core.Download.Clients.Putio public void AddTorrentFromUrl(string torrentUrl, PutioSettings settings) { - // var arguments = new Dictionary(); - // arguments.Add("url", torrentUrl); - // ProcessRequest(Method.POST, "transfers/add", arguments, settings); + var request = BuildRequest(HttpMethod.Post, "transfers/add", settings); + request.AddFormParameter("url", torrentUrl); + + if (settings.SaveParentId.IsNotNullOrWhiteSpace()) + { + request.AddFormParameter("save_parent_id", settings.SaveParentId); + } + + Execute(request); } public void AddTorrentFromData(byte[] torrentData, PutioSettings settings) @@ -79,7 +86,14 @@ namespace NzbDrone.Core.Download.Clients.Putio try { - return _httpClient.Get(request); + if (requestBuilder.Method == HttpMethod.Post) + { + return _httpClient.Post(request); + } + else + { + return _httpClient.Get(request); + } } catch (HttpException ex) {