You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think it will break out of the pagination loop when we hit our entry limit as-is. It will keep looping through the extra pages doing nothing.
I'm wondering if we should have a limit by default for the popular/trending lists... My only hesitation there is that it might be confusing that those get limited by default but other lists don't. I'm also not sure what a reasonable default number would be.
I think the proper way for now is not to set any default limits, but just amend wiki page for trakt_list, to add a note that popular/trending lists are huge, and it's reasonable to set a limit when using them.
Cool, I'm good with this as is then. We should definitely update the wiki page with the limit option and mention it's probably wanted in any situation using popular/trending lists. If we end up deciding there should be a default limit later we can always add it. Pagination optimization probably isn't worth it given that we request 1000 items per page.
There is currently 160,121 items in the popular movies list, with the 2 second limit, that's over 5 minutes to fetch the list. Would be really nice if it broke out of the pagination loop. Should I put in a separate issue?
2019-05-08 14:34 VERBOSE trakt_list Auto-Movies Retrieving `movies` list `popular`
2019-05-08 14:34 DEBUG utils.requests Auto-Movies GETing URL https://api.trakt.tv/movies/popular with args () and kwargs {'allow_redirects': True, u'timeout': 30}
2019-05-08 14:34 DEBUG trakt_list Auto-Movies Response is paginated. Number of items: 160121, number of pages: 161.0
2019-05-08 14:34 DEBUG utils.requests Auto-Movies Waiting 1.91 seconds until next request to trakt.tv
2019-05-08 14:34 DEBUG utils.requests Auto-Movies GETing URL https://api.trakt.tv/movies/popular with args () and kwargs {'allow_redirects': True, 'params': {u'limit': 1000, u'page': 1}, u'timeout': 30}
2019-05-08 14:34 DEBUG utils.requests Auto-Movies Waiting 1.95 seconds until next request to trakt.tv
2019-05-08 14:34 DEBUG utils.requests Auto-Movies GETing URL https://api.trakt.tv/movies/popular with args () and kwargs {'allow_redirects': True, 'params': {u'limit': 1000, u'page': 2}, u'timeout': 30}
2019-05-08 14:34 DEBUG utils.requests Auto-Movies Waiting 1.96 seconds until next request to trakt.tv
2019-05-08 14:34 DEBUG utils.requests Auto-Movies GETing URL https://api.trakt.tv/movies/popular with args () and kwargs {'allow_redirects': True, 'params': {u'limit': 1000, u'page': 3}, u'timeout': 30}
2019-05-08 14:34 DEBUG utils.requests Auto-Movies Waiting 1.94 seconds until next request to trakt.tv
2019-05-08 14:34 DEBUG utils.requests Auto-Movies GETing URL https://api.trakt.tv/movies/popular with args () and kwargs {'allow_redirects': True, 'params': {u'limit': 1000, u'page': 4}, u'timeout': 30}
2019-05-08 14:34 DEBUG utils.requests Auto-Movies Waiting 1.96 seconds until next request to trakt.tv
2019-05-08 14:34 DEBUG utils.requests Auto-Movies GETing URL https://api.trakt.tv/movies/popular with args () and kwargs {'allow_redirects': True, 'params': {u'limit': 1000, u'page': 5}, u'timeout': 30}
2019-05-08 14:34 DEBUG utils.requests Auto-Movies Waiting 1.96 seconds until next request to trakt.tv
Ohhh. Yeah, let's make a separate issue since this is merged. If there are that many in the list, I reverse my stance on both of those points above. I think we should both stop the pagination loop early, as well as institute a default limit when either of these big lists are specified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for changes:
Currently lists
popularandtrendingproduce TONS of items, and you need to do additional magic to get just TOP10 or so.Detailed changes:
limitconfiguration parameter intotrakt_list