mirror of
https://github.com/C9Glax/tranga.git
synced 2025-01-12 03:17:33 +01:00
Fix #281 Manganato errors when there is no chapters uploaded
This commit is contained in:
parent
5a8202f872
commit
204fb7614d
@ -130,13 +130,13 @@ public class Manganato : MangaConnector
|
|||||||
|
|
||||||
string pattern = "MMM dd,yyyy HH:mm";
|
string pattern = "MMM dd,yyyy HH:mm";
|
||||||
|
|
||||||
HtmlNode oldestChapter = document.DocumentNode
|
HtmlNode? oldestChapter = document.DocumentNode
|
||||||
.SelectNodes("//span[contains(concat(' ',normalize-space(@class),' '),' chapter-time ')]").MaxBy(
|
.SelectNodes("//span[contains(concat(' ',normalize-space(@class),' '),' chapter-time ')]").MaxBy(
|
||||||
node => DateTime.ParseExact(node.GetAttributeValue("title", "Dec 31 2400, 23:59"), pattern,
|
node => DateTime.ParseExact(node.GetAttributeValue("title", "Dec 31 2400, 23:59"), pattern,
|
||||||
CultureInfo.InvariantCulture).Millisecond)!;
|
CultureInfo.InvariantCulture).Millisecond);
|
||||||
|
|
||||||
|
|
||||||
int year = DateTime.ParseExact(oldestChapter.GetAttributeValue("title", "Dec 31 2400, 23:59"), pattern,
|
int year = DateTime.ParseExact(oldestChapter?.GetAttributeValue("title", "Dec 31 2400, 23:59")??"Dec 31 2400, 23:59", pattern,
|
||||||
CultureInfo.InvariantCulture).Year;
|
CultureInfo.InvariantCulture).Year;
|
||||||
|
|
||||||
Manga manga = new (sortName, authors.ToList(), description, altTitles, tags.ToArray(), posterUrl, coverFileNameInCache, links,
|
Manga manga = new (sortName, authors.ToList(), description, altTitles, tags.ToArray(), posterUrl, coverFileNameInCache, links,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user