From f3d4f84fde24bb92e7cf6a22d94a703c753f3cbe Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 14 Aug 2026 05:21:15 +0200 Subject: Working files and symlinks? --- Rhea/StoreMetaService.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Rhea/StoreMetaService.cs (limited to 'Rhea/StoreMetaService.cs') diff --git a/Rhea/StoreMetaService.cs b/Rhea/StoreMetaService.cs new file mode 100644 index 0000000..6b92cd6 --- /dev/null +++ b/Rhea/StoreMetaService.cs @@ -0,0 +1,22 @@ +using ArcaneLibs.Collections; + +namespace Rhea; + +public class StoreMetaService(RheaConfiguration cfg) +{ + private LruCache _storePathsByBaseName = new(10000); + + public async Task GetStorePathByBaseName(string baseName) + { + return await _storePathsByBaseName.GetOrAddAsync(baseName, async () => + { + foreach (var path in Directory.EnumerateFileSystemEntries(cfg.StorePath)) + { + Console.WriteLine(path[(cfg.StorePath.Length + 1)..]); + if (path.StartsWith(baseName + '-')) return path; + } + + return ""; + }); + } +} \ No newline at end of file -- cgit 1.5.1