-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support sorting for the /watchlist endpoint #58
Comments
/watchlist
This isn't easily accomplished since a lot of sorting parameters require a lot of logic to do. That is why the website does sorting client side since the database queries and joins would be too intense. What sorting options are you specifically trying to apply? I can look into specific use cases and see if anything is possible without being a performance hit. In general though, we return all lists in ranked order since it was a performance issue when we created that API method. |
I understand. I don't know the complexity behind them in terms of queries but here would be my : added: would be super useful, the only one I'm really looking forward to seeing if only one can be achieved - seems pretty easy to cache too Less useful in my opinion: |
Any updates on this ? |
I was able to support sorting by |
@rectifyer is this available in prod already? I can't see it in the documentation. |
Oops, there was a typo that hid the documentation updates. Should be there now. https://trakt.docs.apiary.io/#reference/sync/get-watchlist/get-watchlist |
Thanks! Will it be always ascending when I request it the list to be sort? Or should I always check the |
You should check that header value. |
It would be great if we could ask the
/watchlist
with a way to sort the result. I'm currently looking to fetch the watchlist page by page but I can't if I want to display the watchlist sorted. I have to either fetch the whole list without paging (I'm not sure it's a good idea for really big watchlists) or fetch everything page by page to be able to sort in-app (but then the user will need to wait until every page are fetched and the sort to happen in-app).One way to handle this would be by adding
X-Sort-By
andX-Sort-How
to the request. If you don't give them in the request, you could still send them back in the response for people relying on it.The text was updated successfully, but these errors were encountered: