Fixed: Skip invalid series paths during validation

This commit is contained in:
Mark McDowall 2024-06-03 16:17:20 -07:00
parent d9b771ab0b
commit d5b131cacd
1 changed files with 5 additions and 1 deletions

View File

@ -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.Tv; using NzbDrone.Core.Tv;
@ -28,7 +29,10 @@ namespace NzbDrone.Core.Validation.Paths
dynamic instance = context.ParentContext.InstanceToValidate; dynamic instance = context.ParentContext.InstanceToValidate;
var instanceId = (int)instance.Id; 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()));
} }
} }
} }