mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-20 13:04:23 +02:00
fix url_for no allowing query params
This commit is contained in:
@@ -36,8 +36,8 @@ async def get_livestream(ls_id: int) -> Optional[Livestream]:
|
|||||||
async def get_livestream_by_track(track_id: int) -> Optional[Livestream]:
|
async def get_livestream_by_track(track_id: int) -> Optional[Livestream]:
|
||||||
row = await db.fetchone(
|
row = await db.fetchone(
|
||||||
"""
|
"""
|
||||||
SELECT livestreams.* FROM livestream.livestreams
|
SELECT livestreams.* AS livestreams FROM livestream.livestreams
|
||||||
INNER JOIN tracks ON tracks.livestream = livestreams.id
|
INNER JOIN livestream.tracks AS tracks ON tracks.livestream = livestreams.id
|
||||||
WHERE tracks.id = ?
|
WHERE tracks.id = ?
|
||||||
""",
|
""",
|
||||||
(track_id,),
|
(track_id,),
|
||||||
|
@@ -75,10 +75,11 @@ class Track(BaseModel):
|
|||||||
if not self.download_url:
|
if not self.download_url:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
url = request.url_for("livestream.track_redirect_download", track_id=self.id)
|
||||||
|
url_with_query = f"{url}?p={payment_hash}"
|
||||||
|
|
||||||
return UrlAction(
|
return UrlAction(
|
||||||
url=request.url_for(
|
url=url_with_query,
|
||||||
"livestream.track_redirect_download", track_id=self.id, p=payment_hash
|
|
||||||
),
|
|
||||||
description=f"Download the track {self.name}!",
|
description=f"Download the track {self.name}!",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user