mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-29 13:25:13 +02:00
Movie reference properly updates UI now
Still need to fix the 'Files' tab to be updated
This commit is contained in:
@@ -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)
|
public void Handle(EpisodeFolderCreatedEvent message)
|
||||||
{
|
{
|
||||||
var series = message.Series;
|
var series = message.Series;
|
||||||
|
@@ -102,6 +102,8 @@ namespace NzbDrone.Core.MediaFiles
|
|||||||
Ensure.That(movie,() => movie).IsNotNull();
|
Ensure.That(movie,() => movie).IsNotNull();
|
||||||
Ensure.That(destinationFilePath, () => destinationFilePath).IsValidPath();
|
Ensure.That(destinationFilePath, () => destinationFilePath).IsValidPath();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var movieFilePath = movieFile.Path ?? Path.Combine(movie.Path, movieFile.RelativePath);
|
var movieFilePath = movieFile.Path ?? Path.Combine(movie.Path, movieFile.RelativePath);
|
||||||
|
|
||||||
if (!_diskProvider.FileExists(movieFilePath))
|
if (!_diskProvider.FileExists(movieFilePath))
|
||||||
@@ -116,7 +118,10 @@ namespace NzbDrone.Core.MediaFiles
|
|||||||
|
|
||||||
_diskTransferService.TransferFile(movieFilePath, destinationFilePath, mode);
|
_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);
|
_updateMovieFileService.ChangeFileDateForFile(movieFile, movie);
|
||||||
|
|
||||||
@@ -157,7 +162,7 @@ namespace NzbDrone.Core.MediaFiles
|
|||||||
if (!_diskProvider.FolderExists(movieFolder))
|
if (!_diskProvider.FolderExists(movieFolder))
|
||||||
{
|
{
|
||||||
CreateFolder(movieFolder);
|
CreateFolder(movieFolder);
|
||||||
newEvent.SeriesFolder = movieFolder;
|
newEvent.MovieFolder = movieFolder;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -95,6 +95,7 @@ namespace NzbDrone.Core.MediaFiles
|
|||||||
_movieFileMover.MoveMovieFile(movieFile, movie);
|
_movieFileMover.MoveMovieFile(movieFile, movie);
|
||||||
|
|
||||||
_mediaFileService.Update(movieFile);
|
_mediaFileService.Update(movieFile);
|
||||||
|
_movieService.UpdateMovie(movie);
|
||||||
renamed.Add(movieFile);
|
renamed.Add(movieFile);
|
||||||
|
|
||||||
_logger.Debug("Renamed movie file: {0}", movieFile);
|
_logger.Debug("Renamed movie file: {0}", movieFile);
|
||||||
@@ -123,7 +124,7 @@ namespace NzbDrone.Core.MediaFiles
|
|||||||
|
|
||||||
public void Execute(RenameMovieCommand 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);
|
var moviesToRename = _movieService.GetMovies(message.MovieIds);
|
||||||
|
|
||||||
foreach(var movie in moviesToRename)
|
foreach(var movie in moviesToRename)
|
||||||
|
Reference in New Issue
Block a user