diff --git a/backend/handlers/handle_spotify.go b/backend/handlers/handle_spotify.go index c60bc78..852a339 100644 --- a/backend/handlers/handle_spotify.go +++ b/backend/handlers/handle_spotify.go @@ -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) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 516ff64..3e1e0f1 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,9 +1,10 @@ services: - nginx: - environment: - - DEV_MODE=true - ports: - - 80:80 - certbot: - profiles: - - disabled + nginx: + environment: + - DEV_MODE=true + - SEED_DB=true + ports: + - 80:80 + certbot: + profiles: + - disabled