From 2fb4bb2ea4ae712cd02eb5ca671533d018b938f4 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Wed, 6 Jul 2022 04:15:16 +0200 Subject: [PATCH] images.yml should once again support local file paths --- src/NadekoBot/Services/Impl/RedisImagesCache.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/NadekoBot/Services/Impl/RedisImagesCache.cs b/src/NadekoBot/Services/Impl/RedisImagesCache.cs index 7e6ce7586..66fd56cdd 100644 --- a/src/NadekoBot/Services/Impl/RedisImagesCache.cs +++ b/src/NadekoBot/Services/Impl/RedisImagesCache.cs @@ -59,6 +59,11 @@ public sealed class ImageCache : IImageCache, INService GetImageKey(url), async () => { + if (url.IsFile) + { + return await File.ReadAllBytesAsync(url.LocalPath); + } + using var http = _httpFactory.CreateClient(); var bytes = await http.GetByteArrayAsync(url); return bytes;