mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-15 03:54:14 +01:00
fixes for pet handling, uploads, clear storage button, remove button while reconnecting, put paused to online/paused, put visible to online
This commit is contained in:
parent
673d098827
commit
3634c06ee5
17 changed files with 241 additions and 179 deletions
|
|
@ -8,18 +8,18 @@ public class FileReplacement
|
|||
{
|
||||
public FileReplacement(List<string> gamePaths, string filePath, FileCacheManager fileDbManager)
|
||||
{
|
||||
GamePaths = gamePaths.Select(g => g.Replace('\\', '/')).ToList();
|
||||
GamePaths = gamePaths.Select(g => g.Replace('\\', '/')).ToHashSet(StringComparer.Ordinal);
|
||||
ResolvedPath = filePath.Replace('\\', '/');
|
||||
HashLazy = new(() => !IsFileSwap ? fileDbManager.GetFileCacheByPath(ResolvedPath)?.Hash ?? string.Empty : string.Empty);
|
||||
}
|
||||
|
||||
public bool Computed => IsFileSwap || !HasFileReplacement || !string.IsNullOrEmpty(Hash);
|
||||
|
||||
public List<string> GamePaths { get; init; } = new();
|
||||
public HashSet<string> GamePaths { get; init; } = new();
|
||||
|
||||
public bool HasFileReplacement => GamePaths.Count >= 1 && GamePaths.Any(p => !string.Equals(p, ResolvedPath, StringComparison.Ordinal));
|
||||
|
||||
public bool IsFileSwap => !Regex.IsMatch(ResolvedPath, @"^[a-zA-Z]:(/|\\)", RegexOptions.ECMAScript) && !string.Equals(GamePaths[0], ResolvedPath, StringComparison.Ordinal);
|
||||
public bool IsFileSwap => !Regex.IsMatch(ResolvedPath, @"^[a-zA-Z]:(/|\\)", RegexOptions.ECMAScript) && !string.Equals(GamePaths.First(), ResolvedPath, StringComparison.Ordinal);
|
||||
|
||||
public string Hash => HashLazy.Value;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue