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.
This commit is contained in:
aditya-K2 2021-11-17 15:06:18 +05:30
parent 7f1c3f7c55
commit 51b63a19e5

View File

@ -81,7 +81,7 @@ func GenerateContentSlice(selectedSuggestion string) ([]interface{}, error) {
ContentSlice = append(ContentSlice, WHITE_AND_BOLD+"Album Tracks :") ContentSlice = append(ContentSlice, WHITE_AND_BOLD+"Album Tracks :")
for a, pathSlice := range aMap { for a, pathSlice := range aMap {
for _, path := range pathSlice { 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 { for trackName, path := range trackList {
pathSlice = append(pathSlice, [2]string{trackName, path}) pathSlice = append(pathSlice, [2]string{trackName, path})
} }
AlbumMap[[2]string{artistName, albumName}] = pathSlice AlbumMap[[2]string{albumName, artistName}] = pathSlice
} }
} }
} }