2013-04-07 10:30:37 +03:00
|
|
|
using System.Linq;
|
2013-02-21 10:07:34 +03:00
|
|
|
using NzbDrone.Core.Datastore;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Indexers
|
|
|
|
{
|
2013-04-07 10:30:37 +03:00
|
|
|
public interface IIndexerRepository : IBasicRepository<IndexerDefinition>
|
2013-02-21 10:07:34 +03:00
|
|
|
{
|
2013-04-07 10:30:37 +03:00
|
|
|
IndexerDefinition Get(string name);
|
2013-02-21 10:07:34 +03:00
|
|
|
}
|
|
|
|
|
2013-04-07 10:30:37 +03:00
|
|
|
public class IndexerRepository : BasicRepository<IndexerDefinition>, IIndexerRepository
|
2013-02-21 10:07:34 +03:00
|
|
|
{
|
2013-03-25 06:51:32 +03:00
|
|
|
public IndexerRepository(IDatabase database)
|
2013-03-24 07:16:00 +03:00
|
|
|
: base(database)
|
2013-02-21 10:07:34 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-04-07 10:30:37 +03:00
|
|
|
public IndexerDefinition Get(string name)
|
2013-02-21 10:07:34 +03:00
|
|
|
{
|
2013-04-07 10:30:37 +03:00
|
|
|
return Query.Single(i => i.Name.ToLower() == name.ToLower());
|
2013-02-21 10:07:34 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|