mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-28 04:46:18 +02:00
Damn, spotify json broken :(
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
<p style="font-size: 22px">Pick a song</p>
|
<p style="font-size: 22px">Pick a song</p>
|
||||||
<q-select
|
<q-select
|
||||||
outlined
|
outlined
|
||||||
v-model="model"
|
v-model="playlist"
|
||||||
:options="playlists"
|
:options="playlists"
|
||||||
label="playlists"
|
label="playlists"
|
||||||
></q-select>
|
></q-select>
|
||||||
@@ -85,8 +85,9 @@
|
|||||||
mixins: [windowMixin],
|
mixins: [windowMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentPlaylist: JSON.parse('{{ firstPlaylist[0] | tojson }}'),
|
currentPlaylist: JSON.parse('{{ firstPlaylist | tojson }}'),
|
||||||
playlists: JSON.parse('{{ playlists | tojson }}'),
|
playlists: JSON.parse('{{ playlists | tojson }}'),
|
||||||
|
playlist: '',
|
||||||
heavyList: [],
|
heavyList: [],
|
||||||
queued: []
|
queued: []
|
||||||
}
|
}
|
||||||
@@ -98,7 +99,6 @@
|
|||||||
this.queued[1] = this.currentPlaylist[5]
|
this.queued[1] = this.currentPlaylist[5]
|
||||||
this.queued[2] = this.currentPlaylist[6]
|
this.queued[2] = this.currentPlaylist[6]
|
||||||
this.queued[3] = this.currentPlaylist[7]
|
this.queued[3] = this.currentPlaylist[7]
|
||||||
console.log(this.currentPlaylist)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@@ -108,6 +108,7 @@ async def api_delete_item(juke_id):
|
|||||||
|
|
||||||
################JUKEBOX ENDPOINTS##################
|
################JUKEBOX ENDPOINTS##################
|
||||||
|
|
||||||
|
######GET ACCESS TOKEN######
|
||||||
|
|
||||||
@jukebox_ext.route("/api/v1/jukebox/jb/<sp_id>/<sp_playlist>", methods=["GET"])
|
@jukebox_ext.route("/api/v1/jukebox/jb/<sp_id>/<sp_playlist>", methods=["GET"])
|
||||||
async def api_get_jukebox_songs(sp_id, sp_playlist):
|
async def api_get_jukebox_songs(sp_id, sp_playlist):
|
||||||
@@ -128,19 +129,19 @@ async def api_get_jukebox_songs(sp_id, sp_playlist):
|
|||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return await api_get_jukebox_songs(sp_id, sp_playlist)
|
return await api_get_jukebox_songs(sp_id, sp_playlist)
|
||||||
|
return r, HTTPStatus.OK
|
||||||
for item in r.json()["items"]:
|
for item in r.json()["items"]:
|
||||||
tracks.append(
|
tracks.append(
|
||||||
{
|
{
|
||||||
"id": item["track"]["id"],
|
"id": str(item["track"]["id"]),
|
||||||
"name": item["track"]["name"],
|
"name": str(item["track"]["name"]),
|
||||||
"album": item["track"]["album"]["name"],
|
"album": str(item["track"]["album"]["name"]),
|
||||||
"artist": item["track"]["artists"][0]["name"],
|
"artist": str(item["track"]["artists"][0]["name"]),
|
||||||
"image": item["track"]["album"]["images"][0]["url"],
|
"image": str(item["track"]["album"]["images"][0]["url"]),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
except AssertionError:
|
except AssertionError:
|
||||||
something = None
|
something = None
|
||||||
print(jsonify(tracks))
|
|
||||||
return tracks, HTTPStatus.OK
|
return tracks, HTTPStatus.OK
|
||||||
|
|
||||||
|
|
||||||
@@ -188,6 +189,7 @@ async def api_get_token(sp_id):
|
|||||||
@jukebox_ext.route("/api/v1/jukebox/jb/<sp_id>/<sp_song>/", methods=["GET"])
|
@jukebox_ext.route("/api/v1/jukebox/jb/<sp_id>/<sp_song>/", methods=["GET"])
|
||||||
async def api_get_jukebox_invoice(sp_id, sp_song):
|
async def api_get_jukebox_invoice(sp_id, sp_song):
|
||||||
jukebox = await get_jukebox(sp_id)
|
jukebox = await get_jukebox(sp_id)
|
||||||
invoice = await create_invoice(wallet_id=jukebox.wallet,amount=jukebox.amount,memo="Jukebox " + jukebox.name)
|
invoice = await create_invoice(wallet_id=jukebox.wallet,amount=jukebox.price,memo=jukebox.title)
|
||||||
|
|
||||||
|
####new table needed to store payment hashes
|
||||||
return invoice, HTTPStatus.OK
|
return invoice, HTTPStatus.OK
|
||||||
|
Reference in New Issue
Block a user