Removed IRenameProvider.

This commit is contained in:
Mark McDowall 2011-04-08 17:08:03 -07:00
parent 29690d9b6f
commit e5413d67d6
7 changed files with 23 additions and 40 deletions

View File

@ -61,7 +61,7 @@ namespace NzbDrone.Core
_kernel.Bind<TvDbProvider>().ToSelf();
_kernel.Bind<HttpProvider>().ToSelf();
_kernel.Bind<SeriesProvider>().ToSelf().InSingletonScope();
_kernel.Bind<IRssSyncProvider>().To<RssSyncProvider>().InSingletonScope();
_kernel.Bind<RssSyncProvider>().ToSelf().InSingletonScope();
_kernel.Bind<ISeasonProvider>().To<SeasonProvider>();
_kernel.Bind<IEpisodeProvider>().To<EpisodeProvider>();
_kernel.Bind<UpcomingEpisodesProvider>().To<UpcomingEpisodesProvider>();
@ -75,7 +75,7 @@ namespace NzbDrone.Core
_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<RenameProvider>().ToSelf().InSingletonScope();
_kernel.Bind<NotificationProvider>().ToSelf().InSingletonScope();
_kernel.Bind<ILogProvider>().To<LogProvider>().InSingletonScope();
_kernel.Bind<IMediaFileProvider>().To<MediaFileProvider>().InSingletonScope();

View File

@ -182,11 +182,10 @@
<Compile Include="Providers\ExternalNotificationProvider.cs" />
<Compile Include="Providers\Feed\NzbsOrgFeedProvider.cs" />
<Compile Include="Providers\HistoryProvider.cs" />
<Compile Include="Providers\IBacklogProvider.cs" />
<Compile Include="Providers\BacklogProvider.cs" />
<Compile Include="Providers\IIndexerProvider.cs" />
<Compile Include="Providers\IndexerProvider.cs" />
<Compile Include="Providers\IRenameProvider.cs" />
<Compile Include="Providers\IRssSyncProvider.cs" />
<Compile Include="Providers\RssSyncProvider.cs" />
<Compile Include="Providers\PostProcessingProvider.cs" />
<Compile Include="Providers\QualityProvider.cs" />
<Compile Include="Providers\RenameProvider.cs" />

View File

@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NzbDrone.Core.Providers
{
public interface IRenameProvider
{
void RenameAll();
void RenameSeries(int seriesId);
void RenameSeason(int seasonId);
void RenameEpisode(int episodeId);
void RenameEpisodeFile(int episodeFileId, bool newDownload);
}
}

View File

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

View File

@ -12,7 +12,7 @@ using NzbDrone.Core.Repository;
namespace NzbDrone.Core.Providers
{
public class RenameProvider : IRenameProvider
public class RenameProvider
{
private readonly SeriesProvider _seriesProvider;
private readonly ISeasonProvider _seasonProvider;
@ -41,8 +41,8 @@ namespace NzbDrone.Core.Providers
_externalNotificationProvider = extenalNotificationProvider;
}
#region IRenameProvider Members
public void RenameAll()
#region RenameProvider Members
public virtual void RenameAll()
{
//Get a list of all episode files/episodes and rename them
@ -61,8 +61,8 @@ namespace NzbDrone.Core.Providers
StartRename();
}
}
public void RenameSeries(int seriesId)
public virtual void RenameSeries(int seriesId)
{
//Get a list of all applicable episode files/episodes and rename them
@ -83,8 +83,8 @@ namespace NzbDrone.Core.Providers
StartRename();
}
}
public void RenameSeason(int seasonId)
public virtual void RenameSeason(int seasonId)
{
//Get a list of all applicable episode files/episodes and rename them
var season = _seasonProvider.GetSeason(seasonId);
@ -105,8 +105,8 @@ namespace NzbDrone.Core.Providers
StartRename();
}
}
public void RenameEpisode(int episodeId)
public virtual void RenameEpisode(int episodeId)
{
//This will properly rename multi-episode files if asked to rename either of the episode
var episode = _episodeProvider.GetEpisode(episodeId);
@ -126,8 +126,8 @@ namespace NzbDrone.Core.Providers
_epsToRename.Add(erm);
StartRename();
}
public void RenameEpisodeFile(int episodeFileId, bool newDownload)
public virtual void RenameEpisodeFile(int episodeFileId, bool newDownload)
{
//This will properly rename multi-episode files if asked to rename either of the episode
var episodeFile = _mediaFileProvider.GetEpisodeFile(episodeFileId);

View File

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

View File

@ -24,19 +24,19 @@ namespace NzbDrone.Web.Controllers
private readonly SeriesProvider _seriesProvider;
private readonly IEpisodeProvider _episodeProvider;
private readonly ISyncProvider _syncProvider;
private readonly IRssSyncProvider _rssSyncProvider;
private readonly RssSyncProvider _rssSyncProvider;
private readonly QualityProvider _qualityProvider;
private readonly IMediaFileProvider _mediaFileProvider;
private readonly IRenameProvider _renameProvider;
private readonly RenameProvider _renameProvider;
private readonly RootDirProvider _rootDirProvider;
private readonly TvDbProvider _tvDbProvider;
//
// GET: /Series/
public SeriesController(ISyncProvider syncProvider, SeriesProvider seriesProvider,
IEpisodeProvider episodeProvider, IRssSyncProvider rssSyncProvider,
IEpisodeProvider episodeProvider, RssSyncProvider rssSyncProvider,
QualityProvider qualityProvider, IMediaFileProvider mediaFileProvider,
IRenameProvider renameProvider, RootDirProvider rootDirProvider,
RenameProvider renameProvider, RootDirProvider rootDirProvider,
TvDbProvider tvDbProvider)
{
_seriesProvider = seriesProvider;