fix: 🐛 Fix a bug with the QR code that always generate a QR code for localhost #4

Merged
lgallet merged 1 commits from fix/QRCode-URL into main 2024-07-01 16:01:39 +00:00
3 changed files with 3 additions and 1 deletions

View File

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

View File

@ -25,6 +25,7 @@ docker run -d \
-e n8n_webhook_create_playlist=N8N_WEBHOOK_URL \
-e n8n_webhook_add_tracks=N8N_WEBHOOK_URL \
-e environment=production \
-e hostname=https://example.com
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 (?, ?, ?, ?)",
(roomid, playlistID, playlistName, spotifyURL))
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",
comment="Enjoy the night \U0001f57a (and share this QRCode with your friends)",
image=qrcode, type="success", roomid=roomid)