Skip to content

Commit

Permalink
Fix limit bug with trending playlists (#1303)
Browse files Browse the repository at this point in the history
  • Loading branch information
piazzatron committed Mar 13, 2021
1 parent df56278 commit e7bb435
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions discovery-provider/src/api/v1/playlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,5 +362,6 @@ def get(self):
else:
key = self.get_cache_key()
playlists = use_redis_cache(key, TRENDING_TTL_SEC, lambda: get_trending_playlists(args))
playlists = playlists[offset: limit + offset]

return success_response(playlists)
2 changes: 1 addition & 1 deletion discovery-provider/src/queries/get_trending_playlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def get_trending_playlists(args):

# Apply limit + offset early to reduce the amount of
# population work we have to do
if limit and offset:
if limit is not None and offset is not None:
playlists = playlists[offset: limit + offset]
playlist_ids = playlist_ids[offset: limit + offset]

Expand Down

0 comments on commit e7bb435

Please sign in to comment.