using HtmlAgilityPack;

namespace MangaReader.Core.Sources.NatoManga.Metadata;

public class NatoMangaHtmlDocument
{
    public HtmlNode? MangaInfoTextNode { get; }
    public HtmlNode? TitleNode { get; }
    public HtmlNode? GenresNode { get; }
    public HtmlNode? ChapterListNode { get; }
    public HtmlNodeCollection? ChapterNodes { get; }

    public NatoMangaHtmlDocument(HtmlDocument document)
    {
        MangaInfoTextNode = document.DocumentNode.SelectSingleNode(".//ul[@class='manga-info-text']");
        TitleNode = MangaInfoTextNode?.SelectSingleNode(".//li//h1");
        GenresNode = MangaInfoTextNode?.SelectSingleNode(".//li[@class='genres']");
        ChapterListNode = document.DocumentNode.SelectSingleNode(".//div[@class='chapter-list']");
        ChapterNodes = ChapterListNode?.SelectNodes(".//div[@class='row']");
    }
}