2
0

Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into cuttingedge

This commit is contained in:
Glax 2024-05-26 18:34:57 +02:00
commit b5e9e03f64

View File

@ -287,8 +287,9 @@ public abstract class MangaConnector : GlobalBase
protected string SaveCoverImageToCache(string url, RequestType requestType)
{
string filetype = url.Split('/')[^1].Split('?')[0].Split('.')[^1];
string filename = $"{DateTime.Now.Ticks.ToString()}.{filetype}";
Regex urlRex = new (@"https?:\/\/((?:[a-zA-Z0-9]+\.)+[a-zA-Z]+)\/(?:.+\/)*(.+\.[a-zA-Z]+)");
Match match = urlRex.Match(url);
string filename = $"{match.Groups[1].Value}-{match.Groups[2].Value}";
string saveImagePath = Path.Join(settings.coverImageCache, filename);
if (File.Exists(saveImagePath))