Restrcutured the database, and updated pipeline to include cover art.
This commit is contained in:
@@ -31,18 +31,21 @@ public class MangaNatoWebCrawler(IHtmlLoader htmlLoader) : MangaWebCrawler
|
||||
RatingPercent = GetRatingPercent(node.AverageRatingNode, node.BestRatingNode),
|
||||
Votes = node.VotesNode != null ? int.Parse(node.VotesNode.InnerText) : 0,
|
||||
Views = GetViews(node.ViewsNode),
|
||||
Description = new()
|
||||
{
|
||||
Name = GetTextFromNodes(node.StoryDescriptionTextNodes),
|
||||
Language = Language.Unknown
|
||||
},
|
||||
Descriptions =
|
||||
[
|
||||
new()
|
||||
{
|
||||
Name = GetTextFromNodes(node.StoryDescriptionTextNodes),
|
||||
Language = Language.Unknown
|
||||
}
|
||||
],
|
||||
Chapters = GetChapters(node.ChapterNodes)
|
||||
};
|
||||
|
||||
return manga;
|
||||
}
|
||||
|
||||
private static List<SourceMangaTitle> GetAlternateTitles(HtmlNode? node)
|
||||
private static SourceMangaTitle[] GetAlternateTitles(HtmlNode? node)
|
||||
{
|
||||
if (node == null)
|
||||
return [];
|
||||
@@ -98,7 +101,7 @@ public class MangaNatoWebCrawler(IHtmlLoader htmlLoader) : MangaWebCrawler
|
||||
};
|
||||
}
|
||||
|
||||
private static List<string> GetGenres(HtmlNode? node)
|
||||
private static string[] GetGenres(HtmlNode? node)
|
||||
{
|
||||
if (node == null)
|
||||
return [];
|
||||
@@ -162,12 +165,12 @@ public class MangaNatoWebCrawler(IHtmlLoader htmlLoader) : MangaWebCrawler
|
||||
return (int)Math.Round(average / best * 100);
|
||||
}
|
||||
|
||||
private static List<SourceMangaChapter> GetChapters(HtmlNodeCollection? chapterNodes)
|
||||
private static SourceMangaChapter[] GetChapters(HtmlNodeCollection? chapterNodes)
|
||||
{
|
||||
List<SourceMangaChapter> chapters = [];
|
||||
|
||||
if (chapterNodes == null)
|
||||
return chapters;
|
||||
return [];
|
||||
|
||||
List<SourceMangaChapter> chapters = [];
|
||||
|
||||
foreach (var node in chapterNodes)
|
||||
{
|
||||
@@ -187,7 +190,7 @@ public class MangaNatoWebCrawler(IHtmlLoader htmlLoader) : MangaWebCrawler
|
||||
chapters.Add(chapter);
|
||||
}
|
||||
|
||||
return chapters;
|
||||
return [.. chapters];
|
||||
}
|
||||
|
||||
private static float GetChapterNumber(HtmlNode? chapterNameNode)
|
||||
|
||||
Reference in New Issue
Block a user