Fixed input string not being in correct format
This commit is contained in:
parent
c965bc38d1
commit
7c7d43021e
1
.gitignore
vendored
1
.gitignore
vendored
@ -19,3 +19,4 @@ riderModule.iml
|
|||||||
/.idea
|
/.idea
|
||||||
cover.jpg
|
cover.jpg
|
||||||
cover.png
|
cover.png
|
||||||
|
/.vscode
|
@ -154,7 +154,7 @@ public class MangaKatana : MangaConnector
|
|||||||
//Return Chapters ordered by Chapter-Number
|
//Return Chapters ordered by Chapter-Number
|
||||||
List<Chapter> chapters = ParseChaptersFromHtml(manga, requestUrl);
|
List<Chapter> chapters = ParseChaptersFromHtml(manga, requestUrl);
|
||||||
Log($"Got {chapters.Count} chapters. {manga}");
|
Log($"Got {chapters.Count} chapters. {manga}");
|
||||||
return chapters.OrderBy(chapter => Convert.ToSingle(chapter.chapterNumber, numberFormatDecimalPoint)).ToArray();
|
return chapters.OrderBy(chapter => chapter.chapterNumber ?? chapter.volumeNumber).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Chapter> ParseChaptersFromHtml(Manga manga, string mangaUrl)
|
private List<Chapter> ParseChaptersFromHtml(Manga manga, string mangaUrl)
|
||||||
@ -167,9 +167,9 @@ public class MangaKatana : MangaConnector
|
|||||||
|
|
||||||
HtmlNode chapterList = document.DocumentNode.SelectSingleNode("//div[contains(@class, 'chapters')]/table/tbody");
|
HtmlNode chapterList = document.DocumentNode.SelectSingleNode("//div[contains(@class, 'chapters')]/table/tbody");
|
||||||
|
|
||||||
Regex volumeRex = new(@"Volume ([0-9]+)");
|
Regex volumeRex = new(@"(Volume ([0-9]+))|(Vol\.[0-9]+)");
|
||||||
Regex chapterNumRex = new(@"https:\/\/mangakatana\.com\/manga\/.+\/c([0-9\.]+)");
|
Regex chapterNumRex = new(@"https:\/\/mangakatana\.com\/manga\/.+\/(c([0-9\.]+))|(v[0-9]+c[0-9]+)");
|
||||||
Regex chapterNameRex = new(@"Chapter [0-9\.]+: (.*)");
|
Regex chapterNameRex = new(@"Chapter [0-9\.]+:? (.*)");
|
||||||
|
|
||||||
|
|
||||||
foreach (HtmlNode chapterInfo in chapterList.Descendants("tr"))
|
foreach (HtmlNode chapterInfo in chapterList.Descendants("tr"))
|
||||||
|
Loading…
Reference in New Issue
Block a user