mirror of
https://github.com/C9Glax/tranga.git
synced 2025-01-12 11:27:32 +01:00
Possible Fix #182
This commit is contained in:
parent
f4996659ef
commit
98bd8a983b
@ -287,8 +287,9 @@ public abstract class MangaConnector : GlobalBase
|
|||||||
|
|
||||||
protected string SaveCoverImageToCache(string url, RequestType requestType)
|
protected string SaveCoverImageToCache(string url, RequestType requestType)
|
||||||
{
|
{
|
||||||
string filetype = url.Split('/')[^1].Split('?')[0].Split('.')[^1];
|
Regex urlRex = new (@"https?:\/\/((?:[a-zA-Z0-9]+\.)+[a-zA-Z]+)\/(?:.+\/)*(.+\.[a-zA-Z]+)");
|
||||||
string filename = $"{DateTime.Now.Ticks.ToString()}.{filetype}";
|
Match match = urlRex.Match(url);
|
||||||
|
string filename = $"{match.Groups[1].Value}-{match.Groups[2].Value}";
|
||||||
string saveImagePath = Path.Join(settings.coverImageCache, filename);
|
string saveImagePath = Path.Join(settings.coverImageCache, filename);
|
||||||
|
|
||||||
if (File.Exists(saveImagePath))
|
if (File.Exists(saveImagePath))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user