minor change to previous commit

This commit is contained in:
aditya-K2 2021-11-16 18:03:36 +05:30
parent 942aea1b7b
commit 46fed215b9

View File

@ -8,6 +8,10 @@ import (
"github.com/aditya-K2/tview" "github.com/aditya-K2/tview"
) )
var (
WHITE_AND_BOLD string = "[#ffffff::b]"
)
func getFormattedString(s string, width int) string { func getFormattedString(s string, width int) string {
if len(s) < width { if len(s) < width {
s += strings.Repeat(" ", (width - len(s))) s += strings.Repeat(" ", (width - len(s)))
@ -56,13 +60,13 @@ func GenerateContentSlice(selectedSuggestion string) ([]interface{}, error) {
return nil, errors.New("empty Search String Provided") return nil, errors.New("empty Search String Provided")
} }
if _, ok := ARTIST_TREE[selectedSuggestion]; ok { if _, ok := ARTIST_TREE[selectedSuggestion]; ok {
ContentSlice = append(ContentSlice, "[#ffffff::b]Artists :") ContentSlice = append(ContentSlice, WHITE_AND_BOLD+"Artists :")
ContentSlice = append(ContentSlice, selectedSuggestion) ContentSlice = append(ContentSlice, selectedSuggestion)
ContentSlice = append(ContentSlice, "[#ffffff::b]Artist Albums :") ContentSlice = append(ContentSlice, WHITE_AND_BOLD+"Artist Albums :")
for albumName := range ARTIST_TREE[selectedSuggestion] { for albumName := range ARTIST_TREE[selectedSuggestion] {
ContentSlice = append(ContentSlice, [2]string{albumName, selectedSuggestion}) ContentSlice = append(ContentSlice, [2]string{albumName, selectedSuggestion})
} }
ContentSlice = append(ContentSlice, "[#ffffff::b]Artist Tracks :") ContentSlice = append(ContentSlice, WHITE_AND_BOLD+"Artist Tracks :")
for albumName, trackList := range ARTIST_TREE[selectedSuggestion] { for albumName, trackList := range ARTIST_TREE[selectedSuggestion] {
for track := range trackList { for track := range trackList {
ContentSlice = append(ContentSlice, [3]string{track, selectedSuggestion, albumName}) ContentSlice = append(ContentSlice, [3]string{track, selectedSuggestion, albumName})