Added MangaDex Api. Updated project structure.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user