mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-17 21:26:22 -04:00
Remove old folder and all contents
This commit is contained in:
@@ -102,8 +102,6 @@ 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))
|
||||
@@ -118,6 +116,9 @@ namespace NzbDrone.Core.MediaFiles
|
||||
|
||||
_diskTransferService.TransferFile(movieFilePath, destinationFilePath, mode);
|
||||
|
||||
var oldMoviePath = new OsPath(movieFilePath).Directory.FullPath.TrimEnd(Path.DirectorySeparatorChar);
|
||||
|
||||
|
||||
var newMoviePath = new OsPath(destinationFilePath).Directory.FullPath.TrimEnd(Path.DirectorySeparatorChar);
|
||||
movie.Path = newMoviePath;
|
||||
|
||||
@@ -137,6 +138,8 @@ namespace NzbDrone.Core.MediaFiles
|
||||
|
||||
_mediaFileAttributeService.SetFilePermissions(destinationFilePath);
|
||||
|
||||
_diskProvider.DeleteFolder(oldMoviePath, true);
|
||||
|
||||
return movieFile;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user