This commit is contained in:
parent
a758f7a199
commit
eaf173573c
@ -391,7 +391,7 @@ func (m *mainModel) Tick() {
|
|||||||
select {
|
select {
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
playing, _ := m.client.PlayerCurrentlyPlaying(m.ctx)
|
playing, _ := m.client.PlayerCurrentlyPlaying(m.ctx)
|
||||||
if playing != nil && playing.Playing {
|
if playing != nil && playing.Playing && playing.Item != nil {
|
||||||
currentlyPlaying = "Now playing " + playing.Item.Name + " by " + playing.Item.Artists[0].Name
|
currentlyPlaying = "Now playing " + playing.Item.Name + " by " + playing.Item.Artists[0].Name
|
||||||
}
|
}
|
||||||
case <-quit:
|
case <-quit:
|
||||||
@ -543,7 +543,7 @@ func InitMain(ctx *gctx.Context, client *spotify.Client, mode Mode) (tea.Model,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if playing != nil && playing.Playing {
|
if playing != nil && playing.Playing && playing.Item != nil {
|
||||||
currentlyPlaying = "Now playing " + playing.Item.Name + " by " + playing.Item.Artists[0].Name
|
currentlyPlaying = "Now playing " + playing.Item.Name + " by " + playing.Item.Artists[0].Name
|
||||||
}
|
}
|
||||||
items := []list.Item{}
|
items := []list.Item{}
|
||||||
|
Loading…
Reference in New Issue
Block a user