Movie reference properly updates UI now

Still need to fix the 'Files' tab to be updated
pull/2/head
Tim Turner 8 years ago
parent 7da2183080
commit 50a5a2de9b

@ -123,6 +123,17 @@ namespace NzbDrone.Core.Extras
// }
//}
// TODO
public void Handle(MovieFolderCreatedEvent message)
{
var movie = message.Movie;
foreach(var extraFileManager in _extraFileManagers)
{
//extraFileManager.CreateAfterMovieImport(movie, message.MovieFolder);
}
}
public void Handle(EpisodeFolderCreatedEvent message)
{
var series = message.Series;

@ -102,6 +102,8 @@ namespace NzbDrone.Core.MediaFiles
Ensure.That(movie,() => movie).IsNotNull();
Ensure.That(destinationFilePath, () => destinationFilePath).IsValidPath();
var movieFilePath = movieFile.Path ?? Path.Combine(movie.Path, movieFile.RelativePath);
if (!_diskProvider.FileExists(movieFilePath))
@ -116,7 +118,10 @@ namespace NzbDrone.Core.MediaFiles
_diskTransferService.TransferFile(movieFilePath, destinationFilePath, mode);
movieFile.RelativePath = movie.Path.GetRelativePathWithoutChildCheck(destinationFilePath);
var newMoviePath = new OsPath(destinationFilePath).Directory.FullPath.TrimEnd(Path.DirectorySeparatorChar);
movie.Path = newMoviePath;
movieFile.RelativePath = movie.Path.GetRelativePath(destinationFilePath);
_updateMovieFileService.ChangeFileDateForFile(movieFile, movie);
@ -157,7 +162,7 @@ namespace NzbDrone.Core.MediaFiles
if (!_diskProvider.FolderExists(movieFolder))
{
CreateFolder(movieFolder);
newEvent.SeriesFolder = movieFolder;
newEvent.MovieFolder = movieFolder;
changed = true;
}

@ -95,6 +95,7 @@ namespace NzbDrone.Core.MediaFiles
_movieFileMover.MoveMovieFile(movieFile, movie);
_mediaFileService.Update(movieFile);
_movieService.UpdateMovie(movie);
renamed.Add(movieFile);
_logger.Debug("Renamed movie file: {0}", movieFile);
@ -123,7 +124,7 @@ namespace NzbDrone.Core.MediaFiles
public void Execute(RenameMovieCommand message)
{
_logger.Debug("Renaming all files for selected movie");
_logger.Debug("Renaming all files for selected movies");
var moviesToRename = _movieService.GetMovies(message.MovieIds);
foreach(var movie in moviesToRename)

Loading…
Cancel
Save