rewrite of indexer/episode search

This commit is contained in:
kay.one 2013-04-07 00:30:37 -07:00
commit a6a4932b44
114 changed files with 2045 additions and 5577 deletions

View file

@ -1,25 +1,23 @@
using System;
using System.Data;
using System.Linq;
using System.Linq;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Core.Indexers
{
public interface IIndexerRepository : IBasicRepository<Indexer>
public interface IIndexerRepository : IBasicRepository<IndexerDefinition>
{
Indexer Find(Type type);
IndexerDefinition Get(string name);
}
public class IndexerRepository : BasicRepository<Indexer>, IIndexerRepository
public class IndexerRepository : BasicRepository<IndexerDefinition>, IIndexerRepository
{
public IndexerRepository(IDatabase database)
: base(database)
{
}
public Indexer Find(Type type)
public IndexerDefinition Get(string name)
{
return Query.Single(i => i.Type == type.ToString());
return Query.Single(i => i.Name.ToLower() == name.ToLower());
}
}
}