mirror of
https://github.com/AMNatty/Mastodon-Circles.git
synced 2024-11-21 18:47:26 -07:00
Move API request limits into the generic ApiClient
Currently only affects MisskeyApiClient, as Mastodon-flavour API is constraint by a server-side hard limit of 40 replies. Prepares for implementing multi-part requests which will allow Mastodon-flavour clients to also follow the same limits.
This commit is contained in:
parent
30dc06657c
commit
79e358ccb1
1 changed files with 9 additions and 4 deletions
|
@ -152,6 +152,11 @@ class ApiClient {
|
||||||
*/
|
*/
|
||||||
constructor(instance) {
|
constructor(instance) {
|
||||||
this._instance = instance;
|
this._instance = instance;
|
||||||
|
// How many objects to max consider per type
|
||||||
|
this._CNT_NOTES = 70;
|
||||||
|
this._CNT_RENOTES = 50;
|
||||||
|
this._CNT_REPLIES = 100;
|
||||||
|
this._CNT_FAVS = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -626,7 +631,7 @@ class MisskeyApiClient extends ApiClient {
|
||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
limit: 70,
|
limit: this._CNT_NOTES,
|
||||||
reply: false,
|
reply: false,
|
||||||
renote: false,
|
renote: false,
|
||||||
}
|
}
|
||||||
|
@ -656,7 +661,7 @@ class MisskeyApiClient extends ApiClient {
|
||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
noteId: note.id,
|
noteId: note.id,
|
||||||
limit: 50,
|
limit: this._CNT_RENOTES,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -682,7 +687,7 @@ class MisskeyApiClient extends ApiClient {
|
||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
noteId: note.id,
|
noteId: note.id,
|
||||||
limit: 100,
|
limit: this._CNT_REPLIES,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -720,7 +725,7 @@ class MisskeyApiClient extends ApiClient {
|
||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
noteId: note.id,
|
noteId: note.id,
|
||||||
limit: 100,
|
limit: this._CNT_FAVS,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue