mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-28 23:06:43 -04:00
New: Added Presets to Indexers to add indexers with default properties. In an older version of NzbDrone these default indexers were added automatically and could not be removed.
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Api.ClientSchema;
|
||||
using NzbDrone.Core.Download;
|
||||
using Omu.ValueInjecter;
|
||||
|
||||
namespace NzbDrone.Api.DownloadClient
|
||||
{
|
||||
public class DownloadClientSchemaModule : NzbDroneRestModule<DownloadClientResource>
|
||||
{
|
||||
private readonly IDownloadClientFactory _downloadClientFactory;
|
||||
|
||||
public DownloadClientSchemaModule(IDownloadClientFactory downloadClientFactory)
|
||||
: base("downloadclient/schema")
|
||||
{
|
||||
_downloadClientFactory = downloadClientFactory;
|
||||
GetResourceAll = GetSchema;
|
||||
}
|
||||
|
||||
private List<DownloadClientResource> GetSchema()
|
||||
{
|
||||
var downloadClients = _downloadClientFactory.Templates();
|
||||
|
||||
var result = new List<DownloadClientResource>(downloadClients.Count);
|
||||
|
||||
foreach (var downloadClient in downloadClients)
|
||||
{
|
||||
var downloadClientResource = new DownloadClientResource();
|
||||
downloadClientResource.InjectFrom(downloadClient);
|
||||
downloadClientResource.Fields = SchemaBuilder.ToSchema(downloadClient.Settings);
|
||||
|
||||
result.Add(downloadClientResource);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user