|
|
@ -117,29 +117,23 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
throw new SameFilenameException("File not moved, source and destination are the same", movieFilePath);
|
|
|
|
throw new SameFilenameException("File not moved, source and destination are the same", movieFilePath);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var transfer = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
movieFile.RelativePath = movie.Path.GetRelativePath(destinationFilePath);
|
|
|
|
movieFile.RelativePath = movie.Path.GetRelativePath(destinationFilePath);
|
|
|
|
|
|
|
|
|
|
|
|
if (localMovie is not null)
|
|
|
|
if (localMovie is not null && _scriptImportDecider.TryImport(movieFilePath, destinationFilePath, localMovie, movieFile, mode) is var scriptImportDecision && scriptImportDecision != ScriptImportDecision.DeferMove)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var scriptImportDecision = _scriptImportDecider.TryImport(movieFilePath, destinationFilePath, localMovie, movieFile, mode);
|
|
|
|
if (scriptImportDecision == ScriptImportDecision.RenameRequested)
|
|
|
|
|
|
|
|
|
|
|
|
switch (scriptImportDecision)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case ScriptImportDecision.DeferMove:
|
|
|
|
try
|
|
|
|
break;
|
|
|
|
{
|
|
|
|
case ScriptImportDecision.RenameRequested:
|
|
|
|
|
|
|
|
MoveMovieFile(movieFile, movie);
|
|
|
|
MoveMovieFile(movieFile, movie);
|
|
|
|
transfer = false;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
catch (SameFilenameException)
|
|
|
|
case ScriptImportDecision.MoveComplete:
|
|
|
|
{
|
|
|
|
transfer = false;
|
|
|
|
_logger.Debug("No rename was required. File already exists at destination.");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
if (transfer)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_diskTransferService.TransferFile(movieFilePath, destinationFilePath, mode);
|
|
|
|
_diskTransferService.TransferFile(movieFilePath, destinationFilePath, mode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|