Skip to content

Commit

Permalink
Revert "Use track cid streaming and fallback track id streaming (#4635)"
Browse files Browse the repository at this point in the history
This reverts commit 051d92a.
  • Loading branch information
Saliou Diallo committed Feb 3, 2023
1 parent a5f71e4 commit e1be2d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions discovery-provider/src/api/v1/tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,15 +461,15 @@ def get(self, track_id):
primary_node = creator_nodes[0]
signature_param = urllib.parse.quote(json.dumps(signature))
track_cid = track["track_cid"]
if not track_cid:
logger.warning(
f"tracks.py | stream | We should not reach here! If you see this, it's because the track with id {track_id} has no track_cid. Please investigate."
)
path = f"tracks/stream/{track_id}"
elif not CID_STREAM_ENABLED:
path = f"tracks/stream/{track_id}"
else:
if CID_STREAM_ENABLED:
if not track_cid:
logger.info(
f"We should not reach here! If you see this, it's because the track with id {track_id} has no track_cid. Please investigate."
)
abort_not_found(track_id, ns)
path = f"tracks/cidstream/{track_cid}?signature={signature_param}"
else:
path = f"tracks/stream/{track_id}"
stream_url = urljoin(primary_node, path)

return stream_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from src.premium_content.signature import get_premium_content_signature
from src.queries.get_authed_user import get_authed_user

CID_STREAM_ENABLED = True
CID_STREAM_ENABLED = False


class GetTrackStreamSignature(TypedDict):
Expand Down

0 comments on commit e1be2d1

Please sign in to comment.