Avoid panic on spotify if not authed
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m35s

This commit is contained in:
2026-03-07 17:46:55 +00:00
parent 9fa953c969
commit 2737b4f0d0
2 changed files with 15 additions and 8 deletions

View File

@@ -53,10 +53,16 @@ func (store *Store) ListeningTo(ctx *gin.Context) {
}
func (store *Store) RecentlyPlayed(ctx *gin.Context) {
if store.SpotifyClient == nil {
ctx.JSON(500, gin.H{"error": "Spotify not authenticated"})
return
}
opts := spotify.RecentlyPlayedOptions{Limit: 3}
if store.RecentSongsFresh() {
ctx.JSON(200, *store.RecentSongs)
return
}
played, err := store.SpotifyClient.PlayerRecentlyPlayedOpt(ctx, &opts)

View File

@@ -2,6 +2,7 @@ services:
nginx:
environment:
- DEV_MODE=true
- SEED_DB=true
ports:
- 80:80
certbot: