mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-17 21:25:39 -04:00
Compare commits
1 Commits
sonarr-pul
...
sonarr-pul
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c0943449b |
@@ -9,7 +9,7 @@ namespace NzbDrone.Core.Validation.Paths
|
|||||||
private readonly IAppFolderInfo _appFolderInfo;
|
private readonly IAppFolderInfo _appFolderInfo;
|
||||||
|
|
||||||
public StartupFolderValidator(IAppFolderInfo appFolderInfo)
|
public StartupFolderValidator(IAppFolderInfo appFolderInfo)
|
||||||
: base("Path cannot be an ancestor of the start up folder")
|
: base("Path cannot be {relationship} the start up folder")
|
||||||
{
|
{
|
||||||
_appFolderInfo = appFolderInfo;
|
_appFolderInfo = appFolderInfo;
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,24 @@ namespace NzbDrone.Core.Validation.Paths
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !_appFolderInfo.StartUpFolder.IsParentPath(context.PropertyValue.ToString());
|
var startupFolder = _appFolderInfo.StartUpFolder;
|
||||||
|
var folder = context.PropertyValue.ToString();
|
||||||
|
|
||||||
|
if (startupFolder.PathEquals(folder))
|
||||||
|
{
|
||||||
|
context.MessageFormatter.AppendArgument("relationship", "set to");
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (startupFolder.IsParentPath(folder))
|
||||||
|
{
|
||||||
|
context.MessageFormatter.AppendArgument("relationship", "child of");
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user