|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Net.Http;
|
|
|
|
|
using FluentValidation.Results;
|
|
|
|
@ -96,6 +97,13 @@ namespace NzbDrone.Core.Applications.LazyLibrarian
|
|
|
|
|
{ "dlpriority", CalculatePriority(indexer.Priority).ToString() }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (indexer.Type == LazyLibrarianProviderType.Torznab)
|
|
|
|
|
{
|
|
|
|
|
parameters.Add("seeders", indexer.MinimumSeeders.ToString());
|
|
|
|
|
parameters.Add("seed_ratio", indexer.SeedRatio.ToString(CultureInfo.InvariantCulture));
|
|
|
|
|
parameters.Add("seed_duration", indexer.SeedTime.ToString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var request = BuildRequest(settings, "/api", "addProvider", HttpMethod.Get, parameters);
|
|
|
|
|
CheckForError(Execute<LazyLibrarianStatus>(request));
|
|
|
|
|
return indexer;
|
|
|
|
@ -115,6 +123,13 @@ namespace NzbDrone.Core.Applications.LazyLibrarian
|
|
|
|
|
{ "dlpriority", CalculatePriority(indexer.Priority).ToString() }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (indexer.Type == LazyLibrarianProviderType.Torznab)
|
|
|
|
|
{
|
|
|
|
|
parameters.Add("seeders", indexer.MinimumSeeders.ToString());
|
|
|
|
|
parameters.Add("seed_ratio", indexer.SeedRatio.ToString(CultureInfo.InvariantCulture));
|
|
|
|
|
parameters.Add("seed_duration", indexer.SeedTime.ToString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var request = BuildRequest(settings, "/api", "changeProvider", HttpMethod.Get, parameters);
|
|
|
|
|
CheckForError(Execute<LazyLibrarianStatus>(request));
|
|
|
|
|
return indexer;
|
|
|
|
|