1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-22 07:43:01 +00:00

Fixed: Skip invalid series paths during validation

This commit is contained in:
Mark McDowall 2024-06-10 20:30:03 -07:00 committed by GitHub
parent a90ab1a8fd
commit 378fedcd9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 3 deletions

View file

@ -37,6 +37,12 @@ namespace NzbDrone.Core.Tv
private void MoveSingleSeries(Series series, 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 series. Try moving files manually", sourcePath, series.Title);
return;
}
if (!_diskProvider.FolderExists(sourcePath))
{
_logger.Debug("Folder '{0}' for '{1}' does not exist, not moving.", sourcePath, series.Title);

View file

@ -1,4 +1,5 @@
using FluentValidation.Validators;
using FluentValidation.Validators;
using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.RootFolders;
@ -24,7 +25,7 @@ namespace NzbDrone.Core.Validation.Paths
context.MessageFormatter.AppendArgument("path", context.PropertyValue.ToString());
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()));
}
}
}

View file

@ -1,5 +1,6 @@
using System.Linq;
using FluentValidation.Validators;
using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Tv;
@ -28,7 +29,10 @@ namespace NzbDrone.Core.Validation.Paths
dynamic instance = context.ParentContext.InstanceToValidate;
var instanceId = (int)instance.Id;
return !_seriesService.GetAllSeriesPaths().Any(s => s.Value.PathEquals(context.PropertyValue.ToString()) && s.Key != instanceId);
// Skip the path for this series and any invalid paths
return !_seriesService.GetAllSeriesPaths().Any(s => s.Key != instanceId &&
s.Value.IsPathValid(PathValidationType.CurrentOs) &&
s.Value.PathEquals(context.PropertyValue.ToString()));
}
}
}