Skip to content

Commit

Permalink
[QA-1822] Only extend playlists at the api level (#10429)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickyrombo authored Nov 12, 2024
1 parent ce7eebd commit 9e7cdc3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
1 change: 1 addition & 0 deletions packages/discovery-provider/src/api/v1/playlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ def get(self, version):
TrendingType.PLAYLISTS, version_list[0]
)
playlists = get_full_trending_playlists(request, args, strategy)
playlists = list(map(extend_playlist, playlists))
return success_response(playlists)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import time

from src.api.v1.helpers import extend_playlist
from src.queries.query_helpers import filter_playlists_with_only_hidden_tracks
from src.utils.db_session import get_db_read_replica
from src.utils.elasticdsl import (
Expand Down Expand Up @@ -101,6 +100,5 @@ def get_top_playlists_es(kind, args):
u = user_by_id[str(p["playlist_owner_id"])]
# omit current_user because top playlists are cached across users
p["user"] = populate_user_metadata_es(u, None)
extend_playlist(p)

return playlists
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
from sqlalchemy.sql.functions import GenericFunction
from sqlalchemy.sql.type_api import TypeEngine

from src.api.v1.helpers import (
extend_playlist,
extend_track,
format_limit,
format_offset,
to_dict,
)
from src.api.v1.helpers import extend_track, format_limit, format_offset, to_dict
from src.models.playlists.aggregate_playlist import AggregatePlaylist
from src.models.playlists.playlist import Playlist
from src.models.social.repost import RepostType
Expand Down Expand Up @@ -362,9 +356,6 @@ def _get_trending_playlists_with_session(
user = users[playlist["playlist_owner_id"]]
if user:
playlist["user"] = user

# Extend the playlists
playlists = list(map(extend_playlist, playlists))
return sorted_playlists


Expand Down

0 comments on commit 9e7cdc3

Please sign in to comment.