#62 ChapterNumber Parsing on Manganato
This commit is contained in:
parent
4156365b18
commit
e2cdf27d40
@ -142,7 +142,12 @@ public class Manganato : MangaConnector
|
||||
return Array.Empty<Chapter>();
|
||||
List<Chapter> chapters = ParseChaptersFromHtml(manga, requestResult.htmlDocument);
|
||||
Log($"Got {chapters.Count} chapters. {manga}");
|
||||
return chapters.OrderBy(chapter => Convert.ToSingle(chapter.chapterNumber, numberFormatDecimalPoint)).ToArray();
|
||||
return chapters.OrderBy(chapter =>
|
||||
{
|
||||
if (float.TryParse(chapter.chapterNumber, numberFormatDecimalPoint, out float chapterNumber))
|
||||
return chapterNumber;
|
||||
else return 0;
|
||||
}).ToArray();
|
||||
}
|
||||
|
||||
private List<Chapter> ParseChaptersFromHtml(Manga manga, HtmlDocument document)
|
||||
@ -160,7 +165,7 @@ public class Manganato : MangaConnector
|
||||
string fullString = chapterInfo.Descendants("a").First(d => d.HasClass("chapter-name")).InnerText;
|
||||
|
||||
string? volumeNumber = volRex.IsMatch(fullString) ? volRex.Match(fullString).Groups[1].Value : null;
|
||||
string chapterNumber = chapterRex.Match(fullString).Groups[1].Value;
|
||||
string chapterNumber = chapterRex.IsMatch(fullString) ? chapterRex.Match(fullString).Groups[1].Value : fullString;
|
||||
string chapterName = nameRex.Match(fullString).Groups[3].Value;
|
||||
string url = chapterInfo.Descendants("a").First(d => d.HasClass("chapter-name"))
|
||||
.GetAttributeValue("href", "");
|
||||
|
Loading…
Reference in New Issue
Block a user