From eecb86ed8f8e8254f32f1119b9604c5e4c65d0ae Mon Sep 17 00:00:00 2001 From: aditya-K2 Date: Sun, 17 Oct 2021 21:42:02 +0530 Subject: [PATCH] Updated the Client Functions Before the Update Function needed the currentDirectoryMap ( the Functionality was not confirmed ) as a parameter but now I have removed the currentDirectoryMap. Instead I have added totalPath ( going to rename this to `absolutePath` ) to the FileNode Struct which is added during the generation of the directory Tree whenever the selected field is called we can just pass the totalPath. --- client.go | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/client.go b/client.go index 2daa00a..32273a0 100644 --- a/client.go +++ b/client.go @@ -7,56 +7,59 @@ import ( // "fmt" ) +var directoryMap map[string][]int = make(map[string][]int) + func togglePlayBack(connection mpd.Client) error { status, err := connection.Status() - if(status["state"] == "play" && err == nil){ + if status["state"] == "play" && err == nil { connection.Pause(true) - } else if(status["state"] == "pause" && err == nil) { + } else if status["state"] == "pause" && err == nil { connection.Play(-1) } return err } -func join ( stringSlice [] string ) string{ +func join(stringSlice []string) string { var _s string = stringSlice[0] - for i:= 1; i