trakt / api-help

Trakt API docs at https://trakt.docs.apiary.io
179 stars 7 forks source link

User's episodes ratings retrieval timeout when rating filter is empty #271

Open defhead opened 3 years ago

defhead commented 3 years ago

Hello,

In user's ratings retrieval endpoint, [GET] https://api.trakt.tv/users/<id>/ratings/<type>/<rating>, the "rating" filter is optional, but in fact, without it the request goes to timeout when the type is "episodes".

Example:

 curl -v -H "Content-Type: application/json" \
-H "Authorization: Bearer <MY_BEARER>" \
-H "trakt-api-key: <MY_API_KEY>" \
-H "trakt-api-version: 2" \
https://api.trakt.tv/users/<my_username>/ratings/episodes/?page=1&limit=5

Adding the "rating" filter, https://api.trakt.tv/users/<my_username>/ratings/episodes/8?page=1&limit=5, resolves the issue.

On movies, seasons and shows ratings retrieval, there is no issues when this filter is empty.

Maybe it's because my account has a lot of watched episodes (~18K), I don't know.

rectifyer commented 2 years ago

Yeah, 18k ratings is the issue. If you provide the username I can troubleshoot further and maybe see why it's timing out even with the pagination params.

defhead commented 2 years ago

Username : eleon

I made some requests on this API just right now, between 04/05/2022 21:20 and 21:40 (GMT). Some of them went to timeout.

Especially when I don't put "page" and/or "limit" parameters. Those are optional, it seems they don't have default values on server side.

eliehaykal commented 2 years ago

Here is another user who informed me of similar timeout issues when retrieving ratings: phox00