From 0a30f1080595a877d8c4b30f796e7055302de2cc Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 3 Jun 2026 08:53:45 -0500 Subject: remove deprecated extension methods --- src/slskd/Common/CommonExtensions.cs | 46 ------------------------------------ 1 file changed, 46 deletions(-) (limited to 'src') diff --git a/src/slskd/Common/CommonExtensions.cs b/src/slskd/Common/CommonExtensions.cs index c37c1550..95721163 100644 --- a/src/slskd/Common/CommonExtensions.cs +++ b/src/slskd/Common/CommonExtensions.cs @@ -381,21 +381,6 @@ namespace slskd .Build() .Deserialize(str); - /// - /// Converts a fully qualified remote filename to a local filename based in the provided - /// , swapping directory characters for those specific to the local OS, removing any - /// characters that are invalid for the local OS, and making the path relative to the remote store (including the - /// filename and the parent folder). - /// - /// The fully qualified remote filename to convert. - /// The base directory for the local filename. - /// The converted filename. - [Obsolete("Find something more intelligent to do instead of this")] - public static string ToLocalFilename(this string remoteFilename, string baseDirectory) - { - return FileSafety.CombineSafely(baseDirectory, remoteFilename.ToLocalRelativeFilename()); - } - /// /// Converts the given path to the normalized format (normalizes path separators to backslashes). /// @@ -429,37 +414,6 @@ namespace slskd return path.Split('\\').TakeLast(1).First(); } - /// - /// Converts a fully qualified remote filename to a local filename, swapping directory characters for those specific - /// to the local OS, removing any characters that are invalid for the local OS, and making the path relative to the - /// remote store (including the filename and the parent folder). - /// - /// The fully qualified remote filename to convert. - /// The converted filename. - [Obsolete("Find something more intelligent to do instead of this")] - public static string ToLocalRelativeFilename(this string remoteFilename) - { - if (string.IsNullOrWhiteSpace(remoteFilename)) - { - throw new ArgumentException($"Invalid remote filename; expected a non-whitespace value, received '{remoteFilename}'", nameof(remoteFilename)); - } - - // normalize path separators - var localizedRemoteFilename = FileSafety.LocalizePath(remoteFilename); - - var parts = localizedRemoteFilename.Split(Path.DirectorySeparatorChar); - - if (parts.Length == 1) - { - return FileSafety.SanitizeFilename(parts.First()); - } - - var file = FileSafety.SanitizeFilename(parts.Last()); - var directory = FileSafety.SanitizeFilename(parts.Reverse().Skip(1).Take(1).Single()); - - return FileSafety.CombineSafely(directory, file); - } - /// /// Converts a ModelStateDictionary into a human-readable format. /// -- cgit v1.2.3