Skip to content
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

Fix purchasing albums w/ SDK #8682

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/discovery-provider/src/api/v1/playlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ def get(self, playlist_id: str):
playlist = get_playlist(playlist_id=decoded_id, current_user_id=current_user_id)
if not playlist:
abort_not_found(playlist_id, ns)
playlist = extend_track(playlist[0])
playlist = extend_playlist(playlist[0])
playlist["stream_conditions"] = get_extended_purchase_gate(
playlist["stream_conditions"]
)
Expand Down
5 changes: 5 additions & 0 deletions packages/discovery-provider/src/queries/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from src import api_helpers, exceptions
from src.queries.get_cid_source import get_cid_source
from src.queries.get_extended_purchase_gate import get_legacy_purchase_gate
from src.queries.get_feed import get_feed
from src.queries.get_follow_intersection_users import get_follow_intersection_users
from src.queries.get_followees_for_user import get_followees_for_user
Expand Down Expand Up @@ -175,6 +176,10 @@ def get_playlists_route():
args["with_users"] = parse_bool_param(request.args.get("with_users"))
args["current_user_id"] = get_current_user_id(required=False)
playlists = get_playlists(args)
for playlist in playlists:
playlist["stream_conditions"] = get_legacy_purchase_gate(
playlist["stream_conditions"]
)
return api_helpers.success_response(playlists)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def update_album_price_history(
if "splits" in usdc_purchase:
splits = usdc_purchase["splits"]
# TODO: [PAY-2553] better validation of splits
if isinstance(splits, dict):
if isinstance(splits, list):
new_record.splits = splits
else:
raise IndexingValidationError(
Expand Down