mirror of
https://github.com/Radarr/Radarr
synced 2025-02-25 15:43:08 +00:00
Movie reference properly updates UI now
Still need to fix the 'Files' tab to be updated
This commit is contained in:
parent
7da2183080
commit
50a5a2de9b
3 changed files with 20 additions and 3 deletions
|
@ -123,6 +123,17 @@ public void Handle(MediaCoversUpdatedEvent message)
|
|||
// }
|
||||
//}
|
||||
|
||||
// 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 @@ private MovieFile TransferFile(MovieFile movieFile, Movie movie, string destinat
|
|||
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 @@ private MovieFile TransferFile(MovieFile movieFile, Movie movie, string destinat
|
|||
|
||||
_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 @@ private void EnsureMovieFolder(MovieFile movieFile, Movie movie, string filePath
|
|||
if (!_diskProvider.FolderExists(movieFolder))
|
||||
{
|
||||
CreateFolder(movieFolder);
|
||||
newEvent.SeriesFolder = movieFolder;
|
||||
newEvent.MovieFolder = movieFolder;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,6 +95,7 @@ private void RenameFiles(List<MovieFile> movieFiles, Movie movie)
|
|||
_movieFileMover.MoveMovieFile(movieFile, movie);
|
||||
|
||||
_mediaFileService.Update(movieFile);
|
||||
_movieService.UpdateMovie(movie);
|
||||
renamed.Add(movieFile);
|
||||
|
||||
_logger.Debug("Renamed movie file: {0}", movieFile);
|
||||
|
@ -123,7 +124,7 @@ public void Execute(RenameMovieFilesCommand message)
|
|||
|
||||
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…
Reference in a new issue