aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Common/Validation/RelativePathAttribute.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-06-04 08:07:48 -0500
committerJP Dillingham <jp@dillingham.me>2026-06-04 08:07:48 -0500
commite5d362836ce8892487864170abdc31fc032989c5 (patch)
tree087b20a4517c755e56e714d18b42aeb013e66543 /src/slskd/Common/Validation/RelativePathAttribute.cs
parent7e0bc2227cc8593b65e3acd587cbc783e561ca6a (diff)
downloadslskd-e5d362836ce8892487864170abdc31fc032989c5.tar.gz
fix junk
Diffstat (limited to 'src/slskd/Common/Validation/RelativePathAttribute.cs')
-rw-r--r--src/slskd/Common/Validation/RelativePathAttribute.cs31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/slskd/Common/Validation/RelativePathAttribute.cs b/src/slskd/Common/Validation/RelativePathAttribute.cs
index 62185a42..1bdbd4fb 100644
--- a/src/slskd/Common/Validation/RelativePathAttribute.cs
+++ b/src/slskd/Common/Validation/RelativePathAttribute.cs
@@ -83,38 +83,11 @@ namespace slskd.Validation
// OS == OperatingSystem.All or .Any;
if (!FileSafety.IsPathRelative(path, os: OperatingSystem.Linux) || !FileSafety.IsPathRelative(path, os: OperatingSystem.Windows))
{
- // this can only be exercised via unit tests; OSPlatform can't be passeed as an attribute argument
- // so, this takes precedent over PlatformAgnostic
- if (!FileSafety.IsPathRelative(path, os: OS))
- {
- return new ValidationResult($"The {validationContext.DisplayName} field must be a relative path.");
- }
- }
- else
- {
- if (!PlatformAgnostic)
- {
- if (!FileSafety.IsPathRelative(path, os: null)) // this OS
- {
- return new ValidationResult($"The {validationContext.DisplayName} field must be a relative path.");
- }
- }
- else
- {
- if (!FileSafety.IsPathRelative(path, os: OSPlatform.Linux))
- {
- return new ValidationResult($"The {validationContext.DisplayName} field must be a relative path.");
- }
-
- if (!FileSafety.IsPathRelative(path, os: OSPlatform.Windows))
- {
- return new ValidationResult($"The {validationContext.DisplayName} field must be a relative path.");
- }
- }
+ return new ValidationResult($"The {validationContext.DisplayName} field must be a relative path.");
}
}
return ValidationResult.Success;
}
}
-}
+} \ No newline at end of file