Added abstraction layeer IHtmlLoader. Finished reorganizing test project folder structure.
This commit is contained in:
@@ -1,20 +1,25 @@
|
||||
using HtmlAgilityPack;
|
||||
using MangaReader.Core.Http;
|
||||
using MangaReader.Core.Metadata;
|
||||
|
||||
namespace MangaReader.Core.Sources.NatoManga.Metadata;
|
||||
|
||||
public class NatoMangaWebCrawler : MangaWebCrawler
|
||||
public class NatoMangaWebCrawler(IHtmlLoader htmlLoader) : MangaWebCrawler
|
||||
{
|
||||
public override string SourceId => "NatoManga";
|
||||
|
||||
public override async Task<SourceManga?> GetMangaAsync(string url, CancellationToken cancellationToken)
|
||||
{
|
||||
HtmlDocument document = await GetHtmlDocumentAsync(url, cancellationToken);
|
||||
HtmlDocument document = await htmlLoader.GetHtmlDocumentAsync(url, cancellationToken);
|
||||
NatoMangaHtmlDocument node = new(document);
|
||||
|
||||
SourceManga manga = new()
|
||||
{
|
||||
Title = node.TitleNode?.InnerText ?? string.Empty,
|
||||
Title = new()
|
||||
{
|
||||
Name = node.TitleNode?.InnerText ?? string.Empty,
|
||||
Language = Common.Language.Unknown
|
||||
},
|
||||
Genres = GetGenres(node.GenresNode),
|
||||
Chapters = GetChapters(node.ChapterNodes)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user