add case for playlist itme
This commit is contained in:
parent
b569bd5bd6
commit
84b3bd2f90
@ -2,11 +2,13 @@ package tui
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.asdf.cafe/abs3nt/gospt/src/commands"
|
||||
"git.asdf.cafe/abs3nt/gospt/src/gctx"
|
||||
"tuxpa.in/a/zlog/log"
|
||||
|
||||
"github.com/atotto/clipboard"
|
||||
"github.com/charmbracelet/bubbles/key"
|
||||
@ -93,6 +95,7 @@ type mainModel struct {
|
||||
func (m *mainModel) PlayRadio() {
|
||||
go m.SendMessage("Starting radio for "+m.list.SelectedItem().(mainItem).Title(), 2*time.Second)
|
||||
selectedItem := m.list.SelectedItem().(mainItem).SpotifyItem
|
||||
log.Info().Msgf("%s", reflect.TypeOf(selectedItem))
|
||||
switch item := selectedItem.(type) {
|
||||
case spotify.SimplePlaylist:
|
||||
go HandlePlaylistRadio(m.ctx, m.commands, item)
|
||||
@ -121,6 +124,9 @@ func (m *mainModel) PlayRadio() {
|
||||
case spotify.PlaylistTrack:
|
||||
go HandleRadio(m.ctx, m.commands, item.Track.SimpleTrack)
|
||||
return
|
||||
case spotify.PlaylistItem:
|
||||
go HandleRadio(m.ctx, m.commands, item.Track.Track.SimpleTrack)
|
||||
return
|
||||
case spotify.SavedTrack:
|
||||
go HandleRadio(m.ctx, m.commands, item.SimpleTrack)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user