1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-12 11:15:43 +02:00
Sonarr/NzbDrone.Core/Providers/IndexerProvider.cs

42 lines
1.2 KiB
C#
Raw Normal View History

2011-04-10 05:44:01 +03:00
using System.Collections.Generic;
using System.Linq;
using NLog;
2011-04-04 06:50:12 +03:00
using NzbDrone.Core.Providers.Core;
using NzbDrone.Core.Repository;
2011-04-10 05:44:01 +03:00
using SubSonic.Repository;
namespace NzbDrone.Core.Providers
{
public class IndexerProvider
{
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
private readonly ConfigProvider _configProvider;
2011-04-10 05:44:01 +03:00
private readonly IRepository _sonicRepo;
public IndexerProvider(IRepository sonicRepo, ConfigProvider configProvider)
{
_sonicRepo = sonicRepo;
_configProvider = configProvider;
}
public virtual List<Indexer> AllIndexers()
{
return _sonicRepo.All<Indexer>().OrderBy(i => i.Order).ToList();
}
public virtual List<Indexer> EnabledIndexers()
{
return _sonicRepo.All<Indexer>().Where(i => i.Enabled).OrderBy(i => i.Order).ToList();
}
public virtual void Update(Indexer indexer)
{
_sonicRepo.Update(indexer);
}
public virtual Indexer Single(int indexerId)
{
return _sonicRepo.Single<Indexer>(indexerId);
}
}
2011-04-10 05:44:01 +03:00
}