From 1785aa28ea7f3ed247c69c654d642a32bcd5472b Mon Sep 17 00:00:00 2001 From: glax Date: Tue, 10 Oct 2023 22:34:47 +0200 Subject: [PATCH] Change coverCacheFilenames, to avoid conflicts and malformatted filenames --- Tranga/MangaConnectors/MangaConnector.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tranga/MangaConnectors/MangaConnector.cs b/Tranga/MangaConnectors/MangaConnector.cs index a6bcef0..5610eaf 100644 --- a/Tranga/MangaConnectors/MangaConnector.cs +++ b/Tranga/MangaConnectors/MangaConnector.cs @@ -247,7 +247,8 @@ public abstract class MangaConnector : GlobalBase protected string SaveCoverImageToCache(string url, byte requestType) { - string filename = url.Split('/')[^1].Split('?')[0]; + string filetype = url.Split('/')[^1].Split('?')[0].Split('.')[^1]; + string filename = $"{DateTime.Now.Ticks.ToString()}.{filetype}"; string saveImagePath = Path.Join(settings.coverImageCache, filename); if (File.Exists(saveImagePath))