|
|
@ -23,6 +23,7 @@ namespace NzbDrone.Core.Extras
|
|
|
|
public class ExtraService : IExtraService,
|
|
|
|
public class ExtraService : IExtraService,
|
|
|
|
IHandle<MediaCoversUpdatedEvent>,
|
|
|
|
IHandle<MediaCoversUpdatedEvent>,
|
|
|
|
IHandle<MovieFolderCreatedEvent>,
|
|
|
|
IHandle<MovieFolderCreatedEvent>,
|
|
|
|
|
|
|
|
IHandle<MovieScannedEvent>,
|
|
|
|
IHandle<MovieRenamedEvent>
|
|
|
|
IHandle<MovieRenamedEvent>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private readonly IMediaFileService _mediaFileService;
|
|
|
|
private readonly IMediaFileService _mediaFileService;
|
|
|
@ -51,7 +52,7 @@ namespace NzbDrone.Core.Extras
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ImportExtraFiles(localMovie, movieFile, isReadOnly);
|
|
|
|
ImportExtraFiles(localMovie, movieFile, isReadOnly);
|
|
|
|
|
|
|
|
|
|
|
|
CreateAfterImport(localMovie.Movie, movieFile);
|
|
|
|
CreateAfterMovieImport(localMovie.Movie, movieFile);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ImportExtraFiles(LocalMovie localMovie, MovieFile movieFile, bool isReadOnly)
|
|
|
|
public void ImportExtraFiles(LocalMovie localMovie, MovieFile movieFile, bool isReadOnly)
|
|
|
@ -119,7 +120,7 @@ namespace NzbDrone.Core.Extras
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void CreateAfterImport(Movie movie, MovieFile movieFile)
|
|
|
|
private void CreateAfterMovieImport(Movie movie, MovieFile movieFile)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach (var extraFileManager in _extraFileManagers)
|
|
|
|
foreach (var extraFileManager in _extraFileManagers)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -128,6 +129,19 @@ namespace NzbDrone.Core.Extras
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Handle(MediaCoversUpdatedEvent message)
|
|
|
|
public void Handle(MediaCoversUpdatedEvent message)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (message.Updated)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var movie = message.Movie;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var extraFileManager in _extraFileManagers)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
extraFileManager.CreateAfterMediaCoverUpdate(movie);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Handle(MovieScannedEvent message)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var movie = message.Movie;
|
|
|
|
var movie = message.Movie;
|
|
|
|
var movieFiles = GetMovieFiles(movie.Id);
|
|
|
|
var movieFiles = GetMovieFiles(movie.Id);
|
|
|
@ -144,7 +158,7 @@ namespace NzbDrone.Core.Extras
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var extraFileManager in _extraFileManagers)
|
|
|
|
foreach (var extraFileManager in _extraFileManagers)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
extraFileManager.CreateAfterMovieImport(movie, message.MovieFolder);
|
|
|
|
extraFileManager.CreateAfterMovieFolder(movie, message.MovieFolder);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|