aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Common/CommonExtensions.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-06-03 08:53:45 -0500
committerJP Dillingham <jp@dillingham.me>2026-06-03 08:53:45 -0500
commit0a30f1080595a877d8c4b30f796e7055302de2cc (patch)
tree904afc30b11ad1c291b81b52f170b01373c7e993 /src/slskd/Common/CommonExtensions.cs
parent4238d66f801af727ecf7bd32041d4945883bf898 (diff)
downloadslskd-0a30f1080595a877d8c4b30f796e7055302de2cc.tar.gz
remove deprecated extension methods
Diffstat (limited to 'src/slskd/Common/CommonExtensions.cs')
-rw-r--r--src/slskd/Common/CommonExtensions.cs46
1 files changed, 0 insertions, 46 deletions
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
@@ -382,21 +382,6 @@ namespace slskd
.Deserialize<T>(str);
/// <summary>
- /// Converts a fully qualified remote filename to a local filename based in the provided
- /// <paramref name="baseDirectory"/>, 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).
- /// </summary>
- /// <param name="remoteFilename">The fully qualified remote filename to convert.</param>
- /// <param name="baseDirectory">The base directory for the local filename.</param>
- /// <returns>The converted filename.</returns>
- [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());
- }
-
- /// <summary>
/// Converts the given path to the normalized format (normalizes path separators to backslashes).
/// </summary>
/// <remarks>
@@ -430,37 +415,6 @@ namespace slskd
}
/// <summary>
- /// 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).
- /// </summary>
- /// <param name="remoteFilename">The fully qualified remote filename to convert.</param>
- /// <returns>The converted filename.</returns>
- [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);
- }
-
- /// <summary>
/// Converts a ModelStateDictionary into a human-readable format.
/// </summary>
/// <param name="dictionary">The ModelStateDictionary to format.</param>