|
|
@ -11,15 +11,20 @@ namespace NzbDrone.Core.Jobs
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private readonly DiskScanProvider _diskScanProvider;
|
|
|
|
private readonly DiskScanProvider _diskScanProvider;
|
|
|
|
private readonly MediaFileProvider _mediaFileProvider;
|
|
|
|
private readonly MediaFileProvider _mediaFileProvider;
|
|
|
|
|
|
|
|
private readonly ExternalNotificationProvider _externalNotificationProvider;
|
|
|
|
|
|
|
|
private readonly SeriesProvider _seriesProvider;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
|
|
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
|
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
[Inject]
|
|
|
|
public RenameEpisodeJob(DiskScanProvider diskScanProvider, MediaFileProvider mediaFileProvider)
|
|
|
|
public RenameEpisodeJob(DiskScanProvider diskScanProvider, MediaFileProvider mediaFileProvider,
|
|
|
|
|
|
|
|
ExternalNotificationProvider externalNotificationProvider, SeriesProvider seriesProvider)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_diskScanProvider = diskScanProvider;
|
|
|
|
_diskScanProvider = diskScanProvider;
|
|
|
|
_mediaFileProvider = mediaFileProvider;
|
|
|
|
_mediaFileProvider = mediaFileProvider;
|
|
|
|
|
|
|
|
_externalNotificationProvider = externalNotificationProvider;
|
|
|
|
|
|
|
|
_seriesProvider = seriesProvider;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string Name
|
|
|
|
public string Name
|
|
|
@ -39,6 +44,12 @@ namespace NzbDrone.Core.Jobs
|
|
|
|
|
|
|
|
|
|
|
|
var episode = _mediaFileProvider.GetEpisodeFile(targetId);
|
|
|
|
var episode = _mediaFileProvider.GetEpisodeFile(targetId);
|
|
|
|
_diskScanProvider.MoveEpisodeFile(episode);
|
|
|
|
_diskScanProvider.MoveEpisodeFile(episode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Start AfterRename
|
|
|
|
|
|
|
|
var series = _seriesProvider.GetSeries(episode.SeriesId);
|
|
|
|
|
|
|
|
var message = String.Format("Renamed: Series {0}, Season: {1}", series.Title, secondaryTargetId);
|
|
|
|
|
|
|
|
_externalNotificationProvider.AfterRename(message, series);
|
|
|
|
|
|
|
|
|
|
|
|
notification.CurrentMessage = String.Format("Episode rename completed for: {0} ", targetId);
|
|
|
|
notification.CurrentMessage = String.Format("Episode rename completed for: {0} ", targetId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|