From af9b9a1c0a0e927b142bf19e09a9a4d7536efa50 Mon Sep 17 00:00:00 2001 From: aditya-K2 Date: Sat, 6 Nov 2021 19:25:23 +0530 Subject: [PATCH] Delete selected song from Playlist. Now, Pressing d deletes the selected song. --- main.go | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 2dd4ab3..3a8f98d 100644 --- a/main.go +++ b/main.go @@ -173,11 +173,29 @@ func main() { UI.App.Stop() return nil } - case 115: + case 115: // s: key { conn.Stop() return nil } + case 117: // u : key + { + _, err = conn.Update("") + if err != nil { + panic(err) + } + return nil + } + case 100: // d : key + { + if InsidePlaylist { + r, _ := UI.expandedView.GetSelection() + conn.Delete(r, -1) + return nil + } else { + return e + } + } default: { return e