|
|
@ -12,13 +12,13 @@ using NzbDrone.Core.Repository;
|
|
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Providers
|
|
|
|
namespace NzbDrone.Core.Providers
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public class RenameProvider : IRenameProvider
|
|
|
|
public class RenameProvider
|
|
|
|
{
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
private readonly IDiskProvider _diskProvider;
|
|
|
|
private readonly DiskProvider _diskProvider;
|
|
|
|
private readonly IConfigProvider _configProvider;
|
|
|
|
private readonly IConfigProvider _configProvider;
|
|
|
|
private readonly ExternalNotificationProvider _externalNotificationProvider;
|
|
|
|
private readonly ExternalNotificationProvider _externalNotificationProvider;
|
|
|
|
|
|
|
|
|
|
|
@ -27,9 +27,9 @@ 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,
|
|
|
|
DiskProvider diskProvider, IConfigProvider configProvider,
|
|
|
|
ExternalNotificationProvider extenalNotificationProvider)
|
|
|
|
ExternalNotificationProvider extenalNotificationProvider)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_seriesProvider = seriesProvider;
|
|
|
|
_seriesProvider = seriesProvider;
|
|
|
@ -41,8 +41,8 @@ namespace NzbDrone.Core.Providers
|
|
|
|
_externalNotificationProvider = extenalNotificationProvider;
|
|
|
|
_externalNotificationProvider = extenalNotificationProvider;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region IRenameProvider Members
|
|
|
|
#region RenameProvider Members
|
|
|
|
public void RenameAll()
|
|
|
|
public virtual void RenameAll()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Get a list of all episode files/episodes and rename them
|
|
|
|
//Get a list of all episode files/episodes and rename them
|
|
|
|
|
|
|
|
|
|
|
@ -62,7 +62,7 @@ namespace NzbDrone.Core.Providers
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void RenameSeries(int seriesId)
|
|
|
|
public virtual void RenameSeries(int seriesId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Get a list of all applicable episode files/episodes and rename them
|
|
|
|
//Get a list of all applicable episode files/episodes and rename them
|
|
|
|
|
|
|
|
|
|
|
@ -84,7 +84,7 @@ namespace NzbDrone.Core.Providers
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void RenameSeason(int seasonId)
|
|
|
|
public virtual void RenameSeason(int seasonId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Get a list of all applicable episode files/episodes and rename them
|
|
|
|
//Get a list of all applicable episode files/episodes and rename them
|
|
|
|
var season = _seasonProvider.GetSeason(seasonId);
|
|
|
|
var season = _seasonProvider.GetSeason(seasonId);
|
|
|
@ -106,7 +106,7 @@ namespace NzbDrone.Core.Providers
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
//This will properly rename multi-episode files if asked to rename either of the episode
|
|
|
|
var episode = _episodeProvider.GetEpisode(episodeId);
|
|
|
|
var episode = _episodeProvider.GetEpisode(episodeId);
|
|
|
@ -127,7 +127,7 @@ namespace NzbDrone.Core.Providers
|
|
|
|
StartRename();
|
|
|
|
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
|
|
|
|
//This will properly rename multi-episode files if asked to rename either of the episode
|
|
|
|
var episodeFile = _mediaFileProvider.GetEpisodeFile(episodeFileId);
|
|
|
|
var episodeFile = _mediaFileProvider.GetEpisodeFile(episodeFileId);
|
|
|
|