mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
Throw when unable to move file
This commit is contained in:
parent
2a44cab543
commit
44772c7391
6 changed files with 39 additions and 21 deletions
|
@ -62,15 +62,12 @@ namespace NzbDrone.Core.MediaFiles
|
|||
{
|
||||
if (!_diskProvider.FileExists(episodeFile.Path))
|
||||
{
|
||||
_logger.Error("Episode file path does not exist, {0}", episodeFile.Path);
|
||||
return null;
|
||||
throw new FileNotFoundException("Episode file path does not exist", episodeFile.Path);
|
||||
}
|
||||
|
||||
//Only rename if existing and new filenames don't match
|
||||
if (DiskProvider.PathEquals(episodeFile.Path, destinationFilename))
|
||||
{
|
||||
_logger.Debug("Skipping file rename, source and destination are the same: {0}", episodeFile.Path);
|
||||
return null;
|
||||
throw new SameFilenameException("File not moved, source and destination are the same", episodeFile.Path);
|
||||
}
|
||||
|
||||
_diskProvider.CreateFolder(new FileInfo(destinationFilename).DirectoryName);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue