|
|
|
@ -11,15 +11,20 @@ namespace NzbDrone.Core.Jobs
|
|
|
|
|
{
|
|
|
|
|
private readonly DiskScanProvider _diskScanProvider;
|
|
|
|
|
private readonly MediaFileProvider _mediaFileProvider;
|
|
|
|
|
private readonly ExternalNotificationProvider _externalNotificationProvider;
|
|
|
|
|
private readonly SeriesProvider _seriesProvider;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
public RenameEpisodeJob(DiskScanProvider diskScanProvider, MediaFileProvider mediaFileProvider)
|
|
|
|
|
public RenameEpisodeJob(DiskScanProvider diskScanProvider, MediaFileProvider mediaFileProvider,
|
|
|
|
|
ExternalNotificationProvider externalNotificationProvider, SeriesProvider seriesProvider)
|
|
|
|
|
{
|
|
|
|
|
_diskScanProvider = diskScanProvider;
|
|
|
|
|
_mediaFileProvider = mediaFileProvider;
|
|
|
|
|
_externalNotificationProvider = externalNotificationProvider;
|
|
|
|
|
_seriesProvider = seriesProvider;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Name
|
|
|
|
@ -39,6 +44,12 @@ namespace NzbDrone.Core.Jobs
|
|
|
|
|
|
|
|
|
|
var episode = _mediaFileProvider.GetEpisodeFile(targetId);
|
|
|
|
|
_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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|