Added MangaDex Api. Updated project structure.

This commit is contained in:
2025-05-26 17:16:25 -04:00
parent 648aa95f32
commit ea8b4a36ff
61 changed files with 4937 additions and 197 deletions

View File

@@ -12,7 +12,7 @@ public abstract class MangaSearchProviderBase<T>(IHttpService httpService) : IMa
public async Task<MangaSearchResult[]> SearchAsync(string keyword, CancellationToken cancellationToken)
{
T? searchResult = await GetSearchResultAsync(keyword);
T? searchResult = await GetSearchResultAsync(keyword, cancellationToken);
if (searchResult == null)
return [];
@@ -20,10 +20,10 @@ public abstract class MangaSearchProviderBase<T>(IHttpService httpService) : IMa
return GetSearchResult(searchResult);
}
private async Task<T?> GetSearchResultAsync(string keyword)
private async Task<T?> GetSearchResultAsync(string keyword, CancellationToken cancellationToken)
{
string url = GetSearchUrl(keyword);
string response = await httpService.GetStringAsync(url);
string response = await httpService.GetStringAsync(url, cancellationToken);
return JsonSerializer.Deserialize<T>(response, _jsonSerializerOptions);
}