From 28ebbef4b6f1515413a2ffd3df683b10091b5da6 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 12 Jun 2022 13:49:34 -0500 Subject: remove the Mask property, and set remote path to the alias --- src/slskd/Shares/Domain/Share.cs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/slskd/Shares/Domain/Share.cs b/src/slskd/Shares/Domain/Share.cs index 9bdbc002..6a6d1f66 100644 --- a/src/slskd/Shares/Domain/Share.cs +++ b/src/slskd/Shares/Domain/Share.cs @@ -33,17 +33,15 @@ namespace slskd.Shares /// /// /// - /// /// /// [JsonConstructor] - public Share (string id, string alias, bool isExcluded, string localPath, string mask, string raw, string remotePath) + public Share (string id, string alias, bool isExcluded, string localPath, string raw, string remotePath) { Id = id; Alias = alias; IsExcluded = isExcluded; LocalPath = localPath; - Mask = mask; Raw = raw; RemotePath = remotePath; } @@ -78,14 +76,7 @@ namespace slskd.Shares LocalPath = share; } - var parent = System.IO.Directory.GetParent(LocalPath).FullName.TrimEnd('/', '\\'); - - Mask = Compute.MaskHash(parent); - - var maskedPath = LocalPath.ReplaceFirst(parent, Mask); - - var aliasedSegment = LocalPath[(parent.Length + 1)..]; - RemotePath = maskedPath.ReplaceFirst(aliasedSegment, Alias); + RemotePath = Alias; Id = Compute.Sha1Hash(RemotePath); } @@ -94,7 +85,6 @@ namespace slskd.Shares public string Alias { get; init; } public bool IsExcluded { get; init; } public string LocalPath { get; init; } - public string Mask { get; init; } public string Raw { get; init; } public string RemotePath { get; init; } } -- cgit v1.2.3