Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/db-2001/cuttingedge' into …
Browse files Browse the repository at this point in the history
…cuttingedge
  • Loading branch information
C9Glax committed Apr 18, 2024
2 parents c67e89f + 4ba44d3 commit 54b24ac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Tranga/Chapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Tranga;
public string fileName { get; }

private static readonly Regex LegalCharacters = new (@"([A-z]*[0-9]* *\.*-*,*\]*\[*'*\'*\)*\(*~*!*)*");
private static readonly Regex IllegalStrings = new(@"Vol(ume)?.?", RegexOptions.IgnoreCase);
private static readonly Regex IllegalStrings = new(@"(Vol(ume)?|Ch(apter)?)\.?", RegexOptions.IgnoreCase);
private static readonly Regex Digits = new(@"[0-9\.]*");
public Chapter(Manga parentManga, string? name, string? volumeNumber, string chapterNumber, string url)
{
Expand Down
9 changes: 9 additions & 0 deletions Tranga/MangaConnectors/MangaConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,15 @@ protected HttpStatusCode DownloadChapterImages(string[] imageUrls, string saveAr

int chapter = 0;
//Download all Images to temporary Folder
if (imageUrls.Length == 0)
{
Log("No images found");
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
File.SetUnixFileMode(saveArchiveFilePath, UserRead | UserWrite | UserExecute | GroupRead | GroupWrite | GroupExecute);
Directory.Delete(tempFolder, true);
progressToken?.Complete();
return HttpStatusCode.NoContent;
}
foreach (string imageUrl in imageUrls)
{
string extension = imageUrl.Split('.')[^1].Split('?')[0];
Expand Down
4 changes: 2 additions & 2 deletions Tranga/MangaConnectors/Mangasee.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ public override Chapter[] GetChapters(Manga manga, string language="en")
string? volumeNumber = m.Groups[2].Success ? m.Groups[2].Value : "1";
string chapterNumber = m.Groups[1].Value;

url = string.Concat(Regex.Match(url, @"(.*)-page-[0-9]+(\.html)").Groups.Values.Select(v => v.Value));
chapters.Add(new Chapter(manga, "", volumeNumber, chapterNumber, url));
string chapterUrl = Regex.Replace(url, @"-page-[0-9]+(\.html)", ".html");
chapters.Add(new Chapter(manga, "", volumeNumber, chapterNumber, chapterUrl));
}

//Return Chapters ordered by Chapter-Number
Expand Down

0 comments on commit 54b24ac

Please sign in to comment.