mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
Can add indexer (in UI)
This commit is contained in:
parent
6351011cce
commit
ea929974f3
8 changed files with 168 additions and 4 deletions
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Indexers.Newznab;
|
||||
using NzbDrone.Core.Lifecycle;
|
||||
|
||||
namespace NzbDrone.Core.Indexers
|
||||
|
@ -21,6 +22,7 @@ namespace NzbDrone.Core.Indexers
|
|||
List<Indexer> All();
|
||||
List<IIndexer> GetAvailableIndexers();
|
||||
Indexer Get(string name);
|
||||
List<Indexer> Schema();
|
||||
}
|
||||
|
||||
public class IndexerService : IIndexerService, IHandle<ApplicationStartedEvent>
|
||||
|
@ -52,6 +54,20 @@ namespace NzbDrone.Core.Indexers
|
|||
return ToIndexer(_indexerRepository.Get(name));
|
||||
}
|
||||
|
||||
public List<Indexer> Schema()
|
||||
{
|
||||
var indexers = new List<Indexer>();
|
||||
|
||||
var newznab = new Indexer();
|
||||
newznab.Instance = new Newznab.Newznab();
|
||||
newznab.Id = 1;
|
||||
newznab.Name = "Newznab";
|
||||
newznab.Settings = new NewznabSettings();
|
||||
|
||||
indexers.Add(newznab);
|
||||
|
||||
return indexers.OrderBy(n => n.Name).ToList();
|
||||
}
|
||||
|
||||
private Indexer ToIndexer(IndexerDefinition definition)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue