Removed ISeriesProvider

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

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

@ -43,7 +43,7 @@ namespace NzbDrone.Core.Test
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)
{
}

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

@ -213,7 +213,6 @@
<Compile Include="Providers\Core\HttpProvider.cs" />
<Compile Include="Providers\IEpisodeProvider.cs" />
<Compile Include="Providers\ISeasonProvider.cs" />
<Compile Include="Providers\ISeriesProvider.cs" />
<Compile Include="Providers\SabProvider.cs" />
<Compile Include="Providers\SeasonProvider.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
private readonly IRepository _sonicRepo;
private readonly ISeriesProvider _series;
private readonly SeriesProvider _series;
private readonly ISeasonProvider _seasons;
private readonly TvDbProvider _tvDb;
private readonly IHistoryProvider _history;
private readonly QualityProvider _quality;
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
public EpisodeProvider(IRepository sonicRepo, ISeriesProvider seriesProvider,
public EpisodeProvider(IRepository sonicRepo, SeriesProvider seriesProvider,
ISeasonProvider seasonProvider, TvDbProvider tvDbProvider,
IHistoryProvider history, QualityProvider quality)
{

@ -8,14 +8,14 @@ namespace NzbDrone.Core.Providers.Feed
{
public abstract class FeedProviderBase
{
protected readonly ISeriesProvider _seriesProvider;
protected readonly SeriesProvider _seriesProvider;
protected readonly ISeasonProvider _seasonProvider;
protected readonly IEpisodeProvider _episodeProvider;
protected readonly IConfigProvider _configProvider;
private readonly HttpProvider _httpProvider;
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)
{
_seriesProvider = seriesProvider;

@ -9,7 +9,7 @@ namespace NzbDrone.Core.Providers.Feed
{
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)
{
}

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

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

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

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

@ -13,7 +13,7 @@ using TvdbLib.Data;
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
@ -34,7 +34,7 @@ namespace NzbDrone.Core.Providers
_quality = quality;
}
#region ISeriesProvider Members
#region SeriesProvider Members
public virtual IQueryable<Series> GetAllSeries()
{

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

@ -11,7 +11,7 @@ namespace NzbDrone.Core.Providers
public class TimerProvider
{
private readonly IRssSyncProvider _rssSyncProvider;
private readonly ISeriesProvider _seriesProvider;
private readonly SeriesProvider _seriesProvider;
private readonly ISeasonProvider _seasonProvider;
private readonly IEpisodeProvider _episodeProvider;
private readonly IMediaFileProvider _mediaFileProvider;
@ -21,7 +21,7 @@ namespace NzbDrone.Core.Providers
private DateTime _rssSyncNextInterval;
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;
_seriesProvider = seriesProvider;

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

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

Loading…
Cancel
Save