Refill
All checks were successful
builder / build (push) Successful in 47s

This commit is contained in:
abs3nt 2024-08-22 00:17:10 -07:00
parent e05de59160
commit 57c97cddb4
Signed by: abs3nt
GPG Key ID: A7BD96A8BAB04C09

View File

@ -365,8 +365,9 @@ func (c *Commander) RefillRadio() error {
if err != nil {
return err
}
paused := false
if !status.Playing {
return nil
paused = true
}
toRemove := []spotify.ID{}
radioPlaylist, db, err := c.GetRadioPlaylist("")
@ -374,15 +375,15 @@ func (c *Commander) RefillRadio() error {
return err
}
if status.PlaybackContext.URI != radioPlaylist.URI {
return nil
}
playlistItems, err := c.Client().GetPlaylistItems(c.Context, radioPlaylist.ID)
if err != nil {
return fmt.Errorf("orig playlist items: %w", err)
}
if status.PlaybackContext.URI != radioPlaylist.URI || paused {
return c.RadioFromPlaylist(radioPlaylist.SimplePlaylist)
}
page := 0
for {
tracks, err := c.Client().GetPlaylistItems(c.Context, radioPlaylist.ID, spotify.Limit(50), spotify.Offset(page*50))