2
0

Fix #249 Manhuaplus where author/tags are not set.

This commit is contained in:
Glax 2024-09-16 19:52:25 +02:00
parent 96f3dbce65
commit 35f2625f05

View File

@ -82,17 +82,31 @@ public class ManhuaPlus : MangaConnector
HtmlNode titleNode = document.DocumentNode.SelectSingleNode("//h1"); HtmlNode titleNode = document.DocumentNode.SelectSingleNode("//h1");
string sortName = titleNode.InnerText.Replace("\n", ""); string sortName = titleNode.InnerText.Replace("\n", "");
HtmlNode[] authorsNodes = document.DocumentNode
.SelectNodes("//a[contains(@href, 'https://manhuaplus.org/authors/')]")
.ToArray();
List<string> authors = new(); List<string> authors = new();
foreach (HtmlNode authorNode in authorsNodes) try
authors.Add(authorNode.InnerText); {
HtmlNode[] authorsNodes = document.DocumentNode
.SelectNodes("//a[contains(@href, 'https://manhuaplus.org/authors/')]")
.ToArray();
foreach (HtmlNode authorNode in authorsNodes)
authors.Add(authorNode.InnerText);
}
catch (ArgumentNullException e)
{
Log("No authors found.");
}
HtmlNode[] genreNodes = document.DocumentNode try
.SelectNodes("//a[contains(@href, 'https://manhuaplus.org/genres/')]").ToArray(); {
foreach (HtmlNode genreNode in genreNodes) HtmlNode[] genreNodes = document.DocumentNode
tags.Add(genreNode.InnerText.Replace("\n", "")); .SelectNodes("//a[contains(@href, 'https://manhuaplus.org/genres/')]").ToArray();
foreach (HtmlNode genreNode in genreNodes)
tags.Add(genreNode.InnerText.Replace("\n", ""));
}
catch (ArgumentNullException e)
{
Log("No genres found");
}
string yearNodeStr = document.DocumentNode string yearNodeStr = document.DocumentNode
.SelectSingleNode("//aside//i[contains(concat(' ',normalize-space(@class),' '),' fa-clock ')]/../span").InnerText.Replace("\n", ""); .SelectSingleNode("//aside//i[contains(concat(' ',normalize-space(@class),' '),' fa-clock ')]/../span").InnerText.Replace("\n", "");