trakt / api-help

Trakt API docs at https://trakt.docs.apiary.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues around official lists

kevincador opened this issue · comments

Hello,

Some issues I spotted while looking at official lists :

  • I've seen a list with 0 item count while there were 3 elements in the list (Divergent Collection) // may just be a random caching issue but I was using that one as a test after watching the series with my daughter 😁
  • at first, I was trying to fetch list items with /users/{slug}/lists/{id}/items but since the trakt or official user doesn't seem to work I switched to /lists/{id}/items (not sure if it's better or not in terms of caching)
  • for liking a list, I'm not sure it's possible to not give the users/{slug}
  • those two last issues would fix themselves if the list was returned with a slug or a username that would work with official lists (I understand there's no real user behind those lists but it's creating some edge cases here and there)
  • just a cosmetic thing but I think a nice trakt logo would be perfect for official lists instead of the Zoidberg 😛

Cheers,

Kevin

PS: thanks for the other fixes 💯

Adding this here because I found out testing this:
it seems like /users/{slug}/lists/{id}/items works for my private lists but /lists/{id}/items gives a 404, so I can't just use that everywhere.

Is there a reason for those two endpoints to work differently? I can add some logic my side but it seems like I'm missing (or overlooking) something.

Justin may have more info on why things are as they are at the moment and whether or not they could be improved, but for what it's worth I have logic to treat those official lists slightly differently, as you've found.

Eg. If the user has no slug, I:
• Omit the /users/{slug} prefix when fetching items
• Avoid showing the likes/comments actions
• Show a Trakt logo for the image

Perhaps these should also check if the username is Trakt, but otherwise your suggestion for the user to have a specific image could be ideal.

Is there a reason for those two endpoints to work differently?

The /lists endpoint actually runs through the search service, which only indexes public lists.

Good suggestions and I'm planning to look into all these.

commented

I've seen a list with 0 item count while there were 3 elements in the list (Divergent Collection) // may just be a random caching issue but I was using that one as a test after watching the series with my daughter

Just wanted to add that as of today I noticed that this issue still persists. items_count is not reliable as it often shows 0 while there are actual items in the list when you query for list items.

Can be noticed with Avatar Collection for example:

image

commented

Those stats update based on user actions (like, comment, etc). I'll add some additional cases to make it regenerate the stats such as refreshing data on one of the list items. This should start fixing itself starting tomorrow as things refresh.

@rectifyer hi. another issue with official lists is that
https://api.trakt.tv/lists/41 (https://trakt.docs.apiary.io/#reference/lists/list/get-list) does not work (error 500) while https://api.trakt.tv/lists/41/items does work. which is quite confusing - you can get items but not metadata :-)

HTTP/2 500
date: Fri, 16 Feb 2024 14:10:31 GMT
content-type: application/json
x-frame-options: SAMEORIGIN
x-xss-protection: 0
x-content-type-options: nosniff
x-download-options: noopen
x-permitted-cross-domain-policies: none
referrer-policy: strict-origin-when-cross-origin
expires: Fri, 16 Feb 2024 22:10:31 GMT
x-sort-by: rank
x-sort-how: asc
cache-control: public, max-age=28800
x-error-message: Internal server error. Please open a support issue and include your full API request and response, including all headers.
vary: Accept-Encoding
x-ratelimit: {"name":"AUTHED_API_GET_LIMIT","period":300,"limit":1000,"remaining":997,"until":"2024-02-16T14:15:00Z"}
x-request-id: 95ab6cee-afb1-43c4-b21d-d8c7518c3103
x-runtime: 0.017220
cf-cache-status: MISS
server: cloudflare
cf-ray: 85665fdf9896380e-FRA
alt-svc: h3=":443"; ma=86400

thanks.

@antonsoroko I'll have a fix out for that later today.