Removed ISeriesProvider

pull/2/head
Mark McDowall 14 years ago
parent bd0a7a58dd
commit c25af5978d

@ -66,7 +66,7 @@ namespace NzbDrone.Core.Test
{ {
//Setup //Setup
var season = new Mock<ISeasonProvider>(); var season = new Mock<ISeasonProvider>();
var series = new Mock<ISeriesProvider>(); var series = new Mock<SeriesProvider>();
//var history = new Mock<IHistoryProvider>(); //var history = new Mock<IHistoryProvider>();
//var quality = new Mock<IQualityProvider>(); //var quality = new Mock<IQualityProvider>();
var repo = new Mock<IRepository>(); var repo = new Mock<IRepository>();

@ -43,7 +43,7 @@ namespace NzbDrone.Core.Test
public class MockFeedProvider : FeedProviderBase public class MockFeedProvider : FeedProviderBase
{ {
public MockFeedProvider(ISeriesProvider seriesProvider, ISeasonProvider seasonProvider, IEpisodeProvider episodeProvider, IConfigProvider configProvider, HttpProvider httpProvider) public MockFeedProvider(SeriesProvider seriesProvider, ISeasonProvider seasonProvider, IEpisodeProvider episodeProvider, IConfigProvider configProvider, HttpProvider httpProvider)
: base(seriesProvider, seasonProvider, episodeProvider, configProvider, httpProvider) : base(seriesProvider, seasonProvider, episodeProvider, configProvider, httpProvider)
{ {
} }

@ -60,23 +60,23 @@ namespace NzbDrone.Core
_kernel.Bind<QualityProvider>().ToSelf(); _kernel.Bind<QualityProvider>().ToSelf();
_kernel.Bind<TvDbProvider>().ToSelf(); _kernel.Bind<TvDbProvider>().ToSelf();
_kernel.Bind<HttpProvider>().ToSelf(); _kernel.Bind<HttpProvider>().ToSelf();
_kernel.Bind<ISeriesProvider>().To<SeriesProvider>().InSingletonScope(); _kernel.Bind<SeriesProvider>().ToSelf().InSingletonScope();
_kernel.Bind<IRssSyncProvider>().To<RssSyncProvider>().InSingletonScope(); _kernel.Bind<IRssSyncProvider>().To<RssSyncProvider>().InSingletonScope();
_kernel.Bind<ISeasonProvider>().To<SeasonProvider>(); _kernel.Bind<ISeasonProvider>().To<SeasonProvider>();
_kernel.Bind<IEpisodeProvider>().To<EpisodeProvider>(); _kernel.Bind<IEpisodeProvider>().To<EpisodeProvider>();
_kernel.Bind<UpcomingEpisodesProvider>().To<UpcomingEpisodesProvider>(); _kernel.Bind<UpcomingEpisodesProvider>().To<UpcomingEpisodesProvider>();
_kernel.Bind<IDiskProvider>().To<DiskProvider>(); _kernel.Bind<IDiskProvider>().To<DiskProvider>();
_kernel.Bind<SabProvider>().To<SabProvider>(); _kernel.Bind<SabProvider>().ToSelf();
_kernel.Bind<IHistoryProvider>().To<HistoryProvider>(); _kernel.Bind<IHistoryProvider>().To<HistoryProvider>();
_kernel.Bind<RootDirProvider>().To<RootDirProvider>(); _kernel.Bind<RootDirProvider>().ToSelf();
_kernel.Bind<ExternalNotificationProvider>().To<ExternalNotificationProvider>(); _kernel.Bind<ExternalNotificationProvider>().ToSelf();
_kernel.Bind<XbmcProvider>().To<XbmcProvider>(); _kernel.Bind<XbmcProvider>().ToSelf();
_kernel.Bind<PostProcessingProvider>().To<PostProcessingProvider>(); _kernel.Bind<PostProcessingProvider>().ToSelf();
_kernel.Bind<IConfigProvider>().To<ConfigProvider>().InSingletonScope(); _kernel.Bind<IConfigProvider>().To<ConfigProvider>().InSingletonScope();
_kernel.Bind<ISyncProvider>().To<SyncProvider>().InSingletonScope(); _kernel.Bind<ISyncProvider>().To<SyncProvider>().InSingletonScope();
_kernel.Bind<IIndexerProvider>().To<IndexerProvider>().InSingletonScope(); _kernel.Bind<IIndexerProvider>().To<IndexerProvider>().InSingletonScope();
_kernel.Bind<IRenameProvider>().To<RenameProvider>().InSingletonScope(); _kernel.Bind<IRenameProvider>().To<RenameProvider>().InSingletonScope();
_kernel.Bind<NotificationProvider>().To<NotificationProvider>().InSingletonScope(); _kernel.Bind<NotificationProvider>().ToSelf().InSingletonScope();
_kernel.Bind<ILogProvider>().To<LogProvider>().InSingletonScope(); _kernel.Bind<ILogProvider>().To<LogProvider>().InSingletonScope();
_kernel.Bind<IMediaFileProvider>().To<MediaFileProvider>().InSingletonScope(); _kernel.Bind<IMediaFileProvider>().To<MediaFileProvider>().InSingletonScope();
_kernel.Bind<TimerProvider>().To<TimerProvider>().InSingletonScope(); _kernel.Bind<TimerProvider>().To<TimerProvider>().InSingletonScope();

@ -213,7 +213,6 @@
<Compile Include="Providers\Core\HttpProvider.cs" /> <Compile Include="Providers\Core\HttpProvider.cs" />
<Compile Include="Providers\IEpisodeProvider.cs" /> <Compile Include="Providers\IEpisodeProvider.cs" />
<Compile Include="Providers\ISeasonProvider.cs" /> <Compile Include="Providers\ISeasonProvider.cs" />
<Compile Include="Providers\ISeriesProvider.cs" />
<Compile Include="Providers\SabProvider.cs" /> <Compile Include="Providers\SabProvider.cs" />
<Compile Include="Providers\SeasonProvider.cs" /> <Compile Include="Providers\SeasonProvider.cs" />
<Compile Include="Repository\Episode.cs" /> <Compile Include="Repository\Episode.cs" />

@ -14,14 +14,14 @@ namespace NzbDrone.Core.Providers
//TODO: Remove parsing of the series name, it should be done in series provider //TODO: Remove parsing of the series name, it should be done in series provider
private readonly IRepository _sonicRepo; private readonly IRepository _sonicRepo;
private readonly ISeriesProvider _series; private readonly SeriesProvider _series;
private readonly ISeasonProvider _seasons; private readonly ISeasonProvider _seasons;
private readonly TvDbProvider _tvDb; private readonly TvDbProvider _tvDb;
private readonly IHistoryProvider _history; private readonly IHistoryProvider _history;
private readonly QualityProvider _quality; private readonly QualityProvider _quality;
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
public EpisodeProvider(IRepository sonicRepo, ISeriesProvider seriesProvider, public EpisodeProvider(IRepository sonicRepo, SeriesProvider seriesProvider,
ISeasonProvider seasonProvider, TvDbProvider tvDbProvider, ISeasonProvider seasonProvider, TvDbProvider tvDbProvider,
IHistoryProvider history, QualityProvider quality) IHistoryProvider history, QualityProvider quality)
{ {

@ -8,14 +8,14 @@ namespace NzbDrone.Core.Providers.Feed
{ {
public abstract class FeedProviderBase public abstract class FeedProviderBase
{ {
protected readonly ISeriesProvider _seriesProvider; protected readonly SeriesProvider _seriesProvider;
protected readonly ISeasonProvider _seasonProvider; protected readonly ISeasonProvider _seasonProvider;
protected readonly IEpisodeProvider _episodeProvider; protected readonly IEpisodeProvider _episodeProvider;
protected readonly IConfigProvider _configProvider; protected readonly IConfigProvider _configProvider;
private readonly HttpProvider _httpProvider; private readonly HttpProvider _httpProvider;
protected static readonly Logger Logger = LogManager.GetCurrentClassLogger(); protected static readonly Logger Logger = LogManager.GetCurrentClassLogger();
public FeedProviderBase(ISeriesProvider seriesProvider, ISeasonProvider seasonProvider, public FeedProviderBase(SeriesProvider seriesProvider, ISeasonProvider seasonProvider,
IEpisodeProvider episodeProvider, IConfigProvider configProvider, HttpProvider httpProvider) IEpisodeProvider episodeProvider, IConfigProvider configProvider, HttpProvider httpProvider)
{ {
_seriesProvider = seriesProvider; _seriesProvider = seriesProvider;

@ -9,7 +9,7 @@ namespace NzbDrone.Core.Providers.Feed
{ {
class NzbsOrgFeedProvider : FeedProviderBase class NzbsOrgFeedProvider : FeedProviderBase
{ {
public NzbsOrgFeedProvider(ISeriesProvider seriesProvider, ISeasonProvider seasonProvider, IEpisodeProvider episodeProvider, IConfigProvider configProvider, HttpProvider httpProvider) public NzbsOrgFeedProvider(SeriesProvider seriesProvider, ISeasonProvider seasonProvider, IEpisodeProvider episodeProvider, IConfigProvider configProvider, HttpProvider httpProvider)
: base(seriesProvider, seasonProvider, episodeProvider, configProvider, httpProvider) : base(seriesProvider, seasonProvider, episodeProvider, configProvider, httpProvider)
{ {
} }

@ -1,30 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Core.Repository;
using NzbDrone.Core.Repository.Quality;
using TvdbLib.Data;
namespace NzbDrone.Core.Providers
{
public interface ISeriesProvider
{
IQueryable<Series> GetAllSeries();
Series GetSeries(int seriesId);
/// <summary>
/// Determines if a series is being actively watched.
/// </summary>
/// <param name="id">The TVDB ID of the series</param>
/// <returns>Whether or not the show is monitored</returns>
bool IsMonitored(long id);
TvdbSeries MapPathToSeries(string path);
void AddSeries(string path, int tvDbSeriesId, int qualityProfileId);
Series FindSeries(string cleanTitle);
bool QualityWanted(int seriesId, QualityTypes quality);
void UpdateSeries(Series series);
void DeleteSeries(int seriesId);
bool SeriesPathExists(string cleanPath);
Series UpdateSeriesInfo(int seriesId);
}
}

@ -11,22 +11,22 @@ namespace NzbDrone.Core.Providers
private Dictionary<Guid, ProgressNotification> _progressNotification = new Dictionary<Guid, ProgressNotification>(); private Dictionary<Guid, ProgressNotification> _progressNotification = new Dictionary<Guid, ProgressNotification>();
private readonly Object _lock = new object(); private readonly Object _lock = new object();
public void Register(ProgressNotification notification) public virtual void Register(ProgressNotification notification)
{ {
_progressNotification.Add(notification.Id, notification); _progressNotification.Add(notification.Id, notification);
} }
public void Register(BasicNotification notification) public virtual void Register(BasicNotification notification)
{ {
_basicNotifications.Add(notification.Id, notification); _basicNotifications.Add(notification.Id, notification);
} }
public List<BasicNotification> BasicNotifications public virtual List<BasicNotification> BasicNotifications
{ {
get { return new List<BasicNotification>(_basicNotifications.Values); } get { return new List<BasicNotification>(_basicNotifications.Values); }
} }
public List<ProgressNotification> GetProgressNotifications public virtual List<ProgressNotification> GetProgressNotifications
{ {
get get
{ {
@ -34,7 +34,7 @@ namespace NzbDrone.Core.Providers
} }
} }
public void Dismiss(Guid notificationId) public virtual void Dismiss(Guid notificationId)
{ {
lock (_lock) lock (_lock)
{ {

@ -11,11 +11,11 @@ namespace NzbDrone.Core.Providers
{ {
public class PostProcessingProvider public class PostProcessingProvider
{ {
private readonly ISeriesProvider _seriesProvider; private readonly SeriesProvider _seriesProvider;
private readonly IMediaFileProvider _mediaFileProvider; private readonly IMediaFileProvider _mediaFileProvider;
private readonly IRenameProvider _renameProvider; private readonly IRenameProvider _renameProvider;
public PostProcessingProvider(ISeriesProvider seriesProvider, public PostProcessingProvider(SeriesProvider seriesProvider,
IMediaFileProvider mediaFileProvider, IRenameProvider renameProvider) IMediaFileProvider mediaFileProvider, IRenameProvider renameProvider)
{ {
_seriesProvider = seriesProvider; _seriesProvider = seriesProvider;

@ -14,7 +14,7 @@ namespace NzbDrone.Core.Providers
{ {
public class RenameProvider : IRenameProvider public class RenameProvider : IRenameProvider
{ {
private readonly ISeriesProvider _seriesProvider; private readonly SeriesProvider _seriesProvider;
private readonly ISeasonProvider _seasonProvider; private readonly ISeasonProvider _seasonProvider;
private readonly IEpisodeProvider _episodeProvider; private readonly IEpisodeProvider _episodeProvider;
private readonly IMediaFileProvider _mediaFileProvider; private readonly IMediaFileProvider _mediaFileProvider;
@ -27,7 +27,7 @@ namespace NzbDrone.Core.Providers
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
public RenameProvider(ISeriesProvider seriesProvider, ISeasonProvider seasonProvider, public RenameProvider(SeriesProvider seriesProvider, ISeasonProvider seasonProvider,
IEpisodeProvider episodeProvider, IMediaFileProvider mediaFileProvider, IEpisodeProvider episodeProvider, IMediaFileProvider mediaFileProvider,
IDiskProvider diskProvider, IConfigProvider configProvider, IDiskProvider diskProvider, IConfigProvider configProvider,
ExternalNotificationProvider extenalNotificationProvider) ExternalNotificationProvider extenalNotificationProvider)

@ -11,11 +11,11 @@ namespace NzbDrone.Core.Providers
public class SeasonProvider : ISeasonProvider public class SeasonProvider : ISeasonProvider
{ {
private readonly IRepository _sonicRepo; private readonly IRepository _sonicRepo;
private readonly ISeriesProvider _seriesProvider; private readonly SeriesProvider _seriesProvider;
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
public SeasonProvider(IRepository dataRepository, ISeriesProvider seriesProvider) public SeasonProvider(IRepository dataRepository, SeriesProvider seriesProvider)
{ {
_sonicRepo = dataRepository; _sonicRepo = dataRepository;
_seriesProvider = seriesProvider; _seriesProvider = seriesProvider;

@ -13,7 +13,7 @@ using TvdbLib.Data;
namespace NzbDrone.Core.Providers namespace NzbDrone.Core.Providers
{ {
public class SeriesProvider : ISeriesProvider public class SeriesProvider
{ {
//TODO: Remove parsing of rest of tv show info we just need the show name //TODO: Remove parsing of rest of tv show info we just need the show name
@ -34,7 +34,7 @@ namespace NzbDrone.Core.Providers
_quality = quality; _quality = quality;
} }
#region ISeriesProvider Members #region SeriesProvider Members
public virtual IQueryable<Series> GetAllSeries() public virtual IQueryable<Series> GetAllSeries()
{ {

@ -13,7 +13,7 @@ namespace NzbDrone.Core.Providers
{ {
public class SyncProvider : ISyncProvider public class SyncProvider : ISyncProvider
{ {
private readonly ISeriesProvider _seriesProvider; private readonly SeriesProvider _seriesProvider;
private readonly IEpisodeProvider _episodeProvider; private readonly IEpisodeProvider _episodeProvider;
private readonly IMediaFileProvider _mediaFileProvider; private readonly IMediaFileProvider _mediaFileProvider;
private readonly NotificationProvider _notificationProvider; private readonly NotificationProvider _notificationProvider;
@ -24,7 +24,7 @@ namespace NzbDrone.Core.Providers
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
public SyncProvider(ISeriesProvider seriesProvider, IEpisodeProvider episodeProvider, public SyncProvider(SeriesProvider seriesProvider, IEpisodeProvider episodeProvider,
IMediaFileProvider mediaFileProvider, NotificationProvider notificationProvider, IMediaFileProvider mediaFileProvider, NotificationProvider notificationProvider,
IDiskProvider diskProvider) IDiskProvider diskProvider)
{ {

@ -11,7 +11,7 @@ namespace NzbDrone.Core.Providers
public class TimerProvider public class TimerProvider
{ {
private readonly IRssSyncProvider _rssSyncProvider; private readonly IRssSyncProvider _rssSyncProvider;
private readonly ISeriesProvider _seriesProvider; private readonly SeriesProvider _seriesProvider;
private readonly ISeasonProvider _seasonProvider; private readonly ISeasonProvider _seasonProvider;
private readonly IEpisodeProvider _episodeProvider; private readonly IEpisodeProvider _episodeProvider;
private readonly IMediaFileProvider _mediaFileProvider; private readonly IMediaFileProvider _mediaFileProvider;
@ -21,7 +21,7 @@ namespace NzbDrone.Core.Providers
private DateTime _rssSyncNextInterval; private DateTime _rssSyncNextInterval;
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
public TimerProvider(IRssSyncProvider rssSyncProvider, ISeriesProvider seriesProvider, ISeasonProvider seasonProvider, IEpisodeProvider episodeProvider, IMediaFileProvider mediaFileProvider) public TimerProvider(IRssSyncProvider rssSyncProvider, SeriesProvider seriesProvider, ISeasonProvider seasonProvider, IEpisodeProvider episodeProvider, IMediaFileProvider mediaFileProvider)
{ {
_rssSyncProvider = rssSyncProvider; _rssSyncProvider = rssSyncProvider;
_seriesProvider = seriesProvider; _seriesProvider = seriesProvider;

@ -18,10 +18,10 @@ namespace NzbDrone.Web.Controllers
private readonly IConfigProvider _configProvider; private readonly IConfigProvider _configProvider;
private readonly QualityProvider _qualityProvider; private readonly QualityProvider _qualityProvider;
private readonly TvDbProvider _tvDbProvider; private readonly TvDbProvider _tvDbProvider;
private readonly ISeriesProvider _seriesProvider; private readonly SeriesProvider _seriesProvider;
public AddSeriesController(ISyncProvider syncProvider, RootDirProvider rootFolderProvider, IConfigProvider configProvider, public AddSeriesController(ISyncProvider syncProvider, RootDirProvider rootFolderProvider, IConfigProvider configProvider,
QualityProvider qualityProvider, TvDbProvider tvDbProvider, ISeriesProvider seriesProvider) QualityProvider qualityProvider, TvDbProvider tvDbProvider, SeriesProvider seriesProvider)
{ {
ConfigProvider = configProvider; ConfigProvider = configProvider;
_syncProvider = syncProvider; _syncProvider = syncProvider;

@ -21,7 +21,7 @@ namespace NzbDrone.Web.Controllers
[HandleError] [HandleError]
public class SeriesController : Controller public class SeriesController : Controller
{ {
private readonly ISeriesProvider _seriesProvider; private readonly SeriesProvider _seriesProvider;
private readonly IEpisodeProvider _episodeProvider; private readonly IEpisodeProvider _episodeProvider;
private readonly ISyncProvider _syncProvider; private readonly ISyncProvider _syncProvider;
private readonly IRssSyncProvider _rssSyncProvider; private readonly IRssSyncProvider _rssSyncProvider;
@ -33,7 +33,7 @@ namespace NzbDrone.Web.Controllers
// //
// GET: /Series/ // GET: /Series/
public SeriesController(ISyncProvider syncProvider, ISeriesProvider seriesProvider, public SeriesController(ISyncProvider syncProvider, SeriesProvider seriesProvider,
IEpisodeProvider episodeProvider, IRssSyncProvider rssSyncProvider, IEpisodeProvider episodeProvider, IRssSyncProvider rssSyncProvider,
QualityProvider qualityProvider, IMediaFileProvider mediaFileProvider, QualityProvider qualityProvider, IMediaFileProvider mediaFileProvider,
IRenameProvider renameProvider, RootDirProvider rootDirProvider, IRenameProvider renameProvider, RootDirProvider rootDirProvider,

Loading…
Cancel
Save