mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-05 15:47:20 +02:00
Fixed: Skip invalid movie paths during validation
(cherry picked from commit 378fedcd9dcb0fe07585727dd7d9e5e765c863c0) Closes #10079
This commit is contained in:
parent
194926c7dd
commit
a12ff68fbd
@ -37,6 +37,12 @@ public MoveMovieService(IMovieService movieService,
|
|||||||
|
|
||||||
private void MoveSingleMovie(Movie movie, string sourcePath, string destinationPath, int? index = null, int? total = null)
|
private void MoveSingleMovie(Movie movie, string sourcePath, string destinationPath, int? index = null, int? total = null)
|
||||||
{
|
{
|
||||||
|
if (!sourcePath.IsPathValid(PathValidationType.CurrentOs))
|
||||||
|
{
|
||||||
|
_logger.Warn("Folder '{0}' for '{1}' is invalid, unable to move movie. Try moving files manually", sourcePath, movie.Title);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!_diskProvider.FolderExists(sourcePath))
|
if (!_diskProvider.FolderExists(sourcePath))
|
||||||
{
|
{
|
||||||
_logger.Debug("Folder '{0}' for '{1}' does not exist, not moving.", sourcePath, movie.Title);
|
_logger.Debug("Folder '{0}' for '{1}' does not exist, not moving.", sourcePath, movie.Title);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using FluentValidation.Validators;
|
using FluentValidation.Validators;
|
||||||
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Core.Movies;
|
using NzbDrone.Core.Movies;
|
||||||
|
|
||||||
@ -28,7 +29,10 @@ protected override bool IsValid(PropertyValidatorContext context)
|
|||||||
|
|
||||||
context.MessageFormatter.AppendArgument("path", context.PropertyValue.ToString());
|
context.MessageFormatter.AppendArgument("path", context.PropertyValue.ToString());
|
||||||
|
|
||||||
return !_moviesService.AllMoviePaths().Any(s => s.Value.PathEquals(context.PropertyValue.ToString()) && s.Key != instanceId);
|
// Skip the path for this movie and any invalid paths
|
||||||
|
return !_moviesService.AllMoviePaths().Any(s => s.Key != instanceId &&
|
||||||
|
s.Value.IsPathValid(PathValidationType.CurrentOs) &&
|
||||||
|
s.Value.PathEquals(context.PropertyValue.ToString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using FluentValidation.Validators;
|
using FluentValidation.Validators;
|
||||||
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Core.RootFolders;
|
using NzbDrone.Core.RootFolders;
|
||||||
|
|
||||||
@ -24,7 +25,7 @@ protected override bool IsValid(PropertyValidatorContext context)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !_rootFolderService.All().Exists(r => r.Path.PathEquals(context.PropertyValue.ToString()));
|
return !_rootFolderService.All().Exists(r => r.Path.IsPathValid(PathValidationType.CurrentOs) && r.Path.PathEquals(context.PropertyValue.ToString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user