Merge pull request 'fix: 🐛 Fix a bug with the QR code that always generate a QR code for localhost' (#4) from fix/QRCode-URL into main

Reviewed-on: #4
This commit is contained in:
Louis Gallet 2024-07-01 16:01:39 +00:00
commit c08573b4b3
3 changed files with 3 additions and 1 deletions

View File

@ -2,4 +2,5 @@ client_id=
client_secret= client_secret=
n8n_webhook_add_tracks= n8n_webhook_add_tracks=
n8n_webhook_create_playlist= n8n_webhook_create_playlist=
hostname=
environment=production environment=production

View File

@ -25,6 +25,7 @@ docker run -d \
-e n8n_webhook_create_playlist=N8N_WEBHOOK_URL \ -e n8n_webhook_create_playlist=N8N_WEBHOOK_URL \
-e n8n_webhook_add_tracks=N8N_WEBHOOK_URL \ -e n8n_webhook_add_tracks=N8N_WEBHOOK_URL \
-e environment=production \ -e environment=production \
-e hostname=https://example.com
gitea.louisgallet.fr/lgallet/makethisplaylist:latest gitea.louisgallet.fr/lgallet/makethisplaylist:latest
``` ```

View File

@ -44,7 +44,7 @@ def create_playlist():
cursor.execute("INSERT INTO rooms (roomid, spotify_id, playlist_name, spotify_URL) VALUES (?, ?, ?, ?)", cursor.execute("INSERT INTO rooms (roomid, spotify_id, playlist_name, spotify_URL) VALUES (?, ?, ?, ?)",
(roomid, playlistID, playlistName, spotifyURL)) (roomid, playlistID, playlistName, spotifyURL))
database.commit() database.commit()
qrcode = generateQRCode("http://localhost:3000/search/" + str(roomid)) qrcode = generateQRCode(os.getenv("hostname") + "/search/" + str(roomid))
return render_template("create.html", response="Playlist created successfully", return render_template("create.html", response="Playlist created successfully",
comment="Enjoy the night \U0001f57a (and share this QRCode with your friends)", comment="Enjoy the night \U0001f57a (and share this QRCode with your friends)",
image=qrcode, type="success", roomid=roomid) image=qrcode, type="success", roomid=roomid)