You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.3 KiB
43 lines
1.3 KiB
using Ninject;
|
|
using NLog;
|
|
using NzbDrone.Core.Model.Notification;
|
|
using NzbDrone.Core.Providers.Core;
|
|
|
|
namespace NzbDrone.Core.Providers.Jobs
|
|
{
|
|
public class RenameEpisodeJob : IJob
|
|
{
|
|
private readonly DiskProvider _diskProvider;
|
|
private readonly EpisodeProvider _episodeProvider;
|
|
private readonly MediaFileProvider _mediaFileProvider;
|
|
private readonly SeriesProvider _seriesProvider;
|
|
|
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
|
|
|
[Inject]
|
|
public RenameEpisodeJob(DiskProvider diskProvider, EpisodeProvider episodeProvider,
|
|
MediaFileProvider mediaFileProvider, SeriesProvider seriesProvider)
|
|
{
|
|
_diskProvider = diskProvider;
|
|
_episodeProvider = episodeProvider;
|
|
_mediaFileProvider = mediaFileProvider;
|
|
_seriesProvider = seriesProvider;
|
|
}
|
|
|
|
public string Name
|
|
{
|
|
get { return "Rename Episode"; }
|
|
}
|
|
|
|
public int DefaultInterval
|
|
{
|
|
get { return 0; }
|
|
}
|
|
|
|
public void Start(ProgressNotification notification, int targetId)
|
|
{
|
|
var episode = _mediaFileProvider.GetEpisodeFile(targetId);
|
|
_mediaFileProvider.RenameEpisodeFile(episode);
|
|
}
|
|
}
|
|
} |