Handling j, k for an empty playlist (Merge 'err')

This commit is contained in:
aditya-K2 2022-05-19 22:51:59 +05:30
commit ccf23a4c13

12
main.go
View File

@ -350,6 +350,18 @@ func main() {
FuncMap[val]() FuncMap[val]()
return nil return nil
} else { } else {
if ui.HasFocus("Playlist") {
if e.Rune() == 'j' || e.Rune() == 'k' {
if p, err := CONN.PlaylistInfo(-1, -1); err != nil {
Notify.Send("Error Getting PlaylistInfo")
} else {
if len(p) == 0 {
Notify.Send("Empty Playlist")
return nil
}
}
}
}
return e return e
} }
}) })