Avoid panic on spotify if not authed
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m35s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m35s
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user