From 51b63a19e5913f17af3293732c39e0dc6f1c296d Mon Sep 17 00:00:00 2001 From: aditya-K2 Date: Wed, 17 Nov 2021 15:06:18 +0530 Subject: [PATCH] Hopefully Fixes the bugs Sometimes on adding a song/artist/album all songs were added to the playlist. This was because of the wrong order in which the array elements were stored. Hopefully this fixes it. --- client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 5fdef2d..48ca4b9 100644 --- a/client.go +++ b/client.go @@ -81,7 +81,7 @@ func GenerateContentSlice(selectedSuggestion string) ([]interface{}, error) { ContentSlice = append(ContentSlice, WHITE_AND_BOLD+"Album Tracks :") for a, pathSlice := range aMap { for _, path := range pathSlice { - ContentSlice = append(ContentSlice, [3]string{path[0], a[0], a[1]}) + ContentSlice = append(ContentSlice, [3]string{path[0], a[1], a[0]}) } } } @@ -279,7 +279,7 @@ func QueryArtistTreeForAlbums(a map[string]map[string]map[string]string, album s for trackName, path := range trackList { pathSlice = append(pathSlice, [2]string{trackName, path}) } - AlbumMap[[2]string{artistName, albumName}] = pathSlice + AlbumMap[[2]string{albumName, artistName}] = pathSlice } } }