@@ -22,7 +22,7 @@ import (
2222type focusArea int
2323
2424const (
25- focusPlaylist focusArea = iota
25+ focusPlaylist focusArea = iota
2626 focusEQ
2727 focusProvPill
2828 focusSearch
@@ -117,7 +117,7 @@ type Model struct {
117117
118118 // Provider state
119119 provider playlist.Provider
120- localProvider * local.Provider // direct ref for write operations (add-to-playlist)
120+ localProvider * local.Provider // direct ref for write operations (add-to-playlist)
121121 providerLists []playlist.PlaylistInfo
122122 provCursor int
123123 provLoading bool
@@ -156,8 +156,8 @@ type Model struct {
156156 feedLoading bool
157157
158158 // Async stream buffering (true while HTTP connect is in progress)
159- buffering bool
160- bufferingAt time.Time // when buffering started, for elapsed display
159+ buffering bool
160+ bufferingAt time.Time // when buffering started, for elapsed display
161161
162162 // resume holds the path and position to seek to when the matching track
163163 // starts playing. Cleared after the seek is performed.
@@ -1392,7 +1392,7 @@ func (m *Model) togglePlayPause() tea.Cmd {
13921392 }
13931393 if m .player .IsPaused () {
13941394 track , idx := m .playlist .Current ()
1395- if idx >= 0 && track . IsLive ( ) {
1395+ if shouldReconnectOnUnpause ( track , idx ) {
13961396 m .player .Stop ()
13971397 return m .playTrack (track )
13981398 }
@@ -1401,6 +1401,12 @@ func (m *Model) togglePlayPause() tea.Cmd {
14011401 return nil
14021402}
14031403
1404+ // shouldReconnectOnUnpause reports whether unpausing should reconnect and
1405+ // restart instead of resuming buffered audio.
1406+ func shouldReconnectOnUnpause (track playlist.Track , idx int ) bool {
1407+ return idx >= 0 && track .IsLive ()
1408+ }
1409+
14041410// lyricsArtistTitle resolves the best artist and title for a lyrics lookup.
14051411// For streams with ICY metadata ("Artist - Song"), it parses the stream title.
14061412// For regular tracks, it uses the track's metadata fields.
0 commit comments