fix crash on start if no playback context
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
5804607c42
commit
7bd2b8c3db
@ -468,6 +468,10 @@ func (m *mainModel) Typing(msg tea.KeyMsg) (bool, tea.Cmd) {
|
|||||||
|
|
||||||
func (m *mainModel) getContext(playing *spotify.CurrentlyPlaying) (string, error) {
|
func (m *mainModel) getContext(playing *spotify.CurrentlyPlaying) (string, error) {
|
||||||
context := playing.PlaybackContext
|
context := playing.PlaybackContext
|
||||||
|
uri_split := strings.Split(string(context.URI), ":")
|
||||||
|
if len(uri_split) < 3 {
|
||||||
|
return "", fmt.Errorf("NO URI")
|
||||||
|
}
|
||||||
id := strings.Split(string(context.URI), ":")[2]
|
id := strings.Split(string(context.URI), ":")[2]
|
||||||
switch context.Type {
|
switch context.Type {
|
||||||
case "album":
|
case "album":
|
||||||
|
Loading…
Reference in New Issue
Block a user