mirror of
https://github.com/C9Glax/tranga.git
synced 2025-05-14 18:33:02 +02:00
Shorten RequestUrl for MangaDex MangaInfo
Lower MaxRequestLimits
This commit is contained in:
parent
57baad3d2c
commit
30a8162777
@ -24,16 +24,15 @@ public class MangaDex : MangaConnector
|
||||
HashSet<(Manga, List<Author>?, List<MangaTag>?, List<Link>?, List<MangaAltTitle>?)> retManga = new();
|
||||
List<JsonNode> results = new();
|
||||
|
||||
publicationTitle = publicationTitle.Replace(" ", "%20");
|
||||
|
||||
//Request all search-results
|
||||
while (offset < total) //As long as we haven't requested all "Pages"
|
||||
{
|
||||
//Request next Page
|
||||
string requestUrl =
|
||||
$"https://api.mangadex.org/manga?limit={limit}&title={publicationTitle}&offset={offset}" +
|
||||
$"&contentRating%5B%5D=safe&contentRating%5B%5D=suggestive&contentRating%5B%5D=erotica" +
|
||||
$"&contentRating%5B%5D=pornographic" +
|
||||
$"&includes%5B%5D=manga&includes%5B%5D=cover_art&includes%5B%5D=author" +
|
||||
$"&includes%5B%5D=artist&includes%5B%5D=tag";
|
||||
$"&includes[]=manga&includes[]=cover_art&includes[]=author&includes[]=artist&includes[]=tag";
|
||||
RequestResult requestResult = downloadClient.MakeRequest(requestUrl, RequestType.MangaInfo);
|
||||
if ((int)requestResult.statusCode < 200 || (int)requestResult.statusCode >= 300)
|
||||
{
|
||||
|
@ -39,11 +39,11 @@ public static class TrangaSettings
|
||||
[JsonIgnore]
|
||||
internal static readonly Dictionary<RequestType, int> DefaultRequestLimits = new ()
|
||||
{
|
||||
{RequestType.MangaInfo, 250},
|
||||
{RequestType.MangaDexFeed, 250},
|
||||
{RequestType.MangaInfo, 60},
|
||||
{RequestType.MangaDexFeed, 60},
|
||||
{RequestType.MangaDexImage, 40},
|
||||
{RequestType.MangaImage, 60},
|
||||
{RequestType.MangaCover, 250},
|
||||
{RequestType.MangaCover, 60},
|
||||
{RequestType.Default, 60}
|
||||
};
|
||||
public static Dictionary<RequestType, int> requestLimits { get; private set; } = DefaultRequestLimits;
|
||||
|
Loading…
x
Reference in New Issue
Block a user