Skip to content

Commit 572eb07

Browse files
authored
Update f785bub0.user.js
1 parent 6feea0f commit 572eb07

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

userscripts/src/f785bub0.user.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name Trakt.tv | Trakt API Wrapper
33
// @description Exposes an authenticated Trakt API Wrapper. Intended to run alongside other userscripts which require (authenticated) access to the Trakt API.
4-
// @version 1.0.1
4+
// @version 1.0.2
55
// @namespace f785bub0
66
// @updateURL https://update.greasyfork.org/scripts/564750.meta.js
77
// @icon https://trakt.tv/assets/logos/logomark.square.gradient-b644b16c38ff775861b4b1f58c1230f6a097a2466ab33ae00445a505c33fcb91.svg
@@ -32,7 +32,7 @@
3232
3333
### Usage
3434
- The wrapper is exposed through `window.userscriptTraktApiWrapper` and can be used like:<br>
35-
`const data = await userscriptTraktApiWrapper.search.id({ id_type: 'trakt', id: 1234, type: 'episode', extended: 'full', _auth: true, _meta: true, _revalidate: true });`<br>
35+
`const { data, meta } = await userscriptTraktApiWrapper.search.id({ id_type: 'trakt', id: 1234, type: 'episode', extended: 'full', _auth: true, _meta: true, _revalidate: true });`<br>
3636
There are two types of props you can pass to a method, parameters corresponding to those listed in the Trakt API docs and options (denoted by a leading `_`) for the wrapper itself.
3737
- ***Parameters***<br>
3838
There are three categories: path parameters, search parameters, and the props for the request's body. First the mandatory and optional parameters for the path
@@ -51,9 +51,8 @@
5151
`limit` gets decremented (= 5 retries) and `req_delay` doubled. If you want to turn it off you can just override it with `_retry: null`.
5252
- In the userscript storage tab you can change the `apiUrl` to `https://api-staging.trakt.tv` for a sandbox environment
5353
and you can activate console logging of all api requests with `logApiRequests`.
54-
- There's built-in rate-limiting for authed `POST`/`PUT`/`DELETE` requests (1/sec), which is complemented by the default `_retry` config, so you can just make a bunch of these
55-
requests at once and they'll be queued up and executed one by one in the same order in which you made them. This is complemented by the default `_retry` config where in this case
56-
a retried request delays all other queued requests.
54+
- There's built-in rate-limiting for authed `POST`/`PUT`/`DELETE` requests (1/sec), which is complemented by the default `_retry` config, so you can just make a bunch of
55+
requests at once and they'll be queued up and executed one by one in the same order in which you made them (retries will block the queue).
5756
*/
5857

5958

0 commit comments

Comments
 (0)