From 07c1a0b5a36ddae2aa7c613b81ab0c9735b98691 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Mon, 24 Apr 2023 22:58:32 +0800 Subject: [PATCH] Init ImageCache from disk --- Flow.Launcher.Infrastructure/Image/ImageCache.cs | 2 +- Flow.Launcher.Infrastructure/Image/ImageLoader.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/Image/ImageCache.cs b/Flow.Launcher.Infrastructure/Image/ImageCache.cs index e7b1f46f7..7a2b57637 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageCache.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageCache.cs @@ -28,7 +28,7 @@ namespace Flow.Launcher.Infrastructure.Image private const int permissibleFactor = 2; private SemaphoreSlim semaphore = new(1, 1); - public void Initialization(Dictionary<(string, bool), int> usage) + public void Initialize(Dictionary<(string, bool), int> usage) { foreach (var key in usage.Keys) { diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index 0a51d56f9..fee2c60bd 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -40,6 +40,8 @@ namespace Flow.Launcher.Infrastructure.Image var usage = LoadStorageToConcurrentDictionary(); + ImageCache.Initialize(usage.ToDictionary(x => x.Key, x => x.Value)); + foreach (var icon in new[] { Constant.DefaultIcon, Constant.MissingImgIcon