crossing out objects with no source

This commit is contained in:
Hazel Noack
2025-10-09 12:14:27 +02:00
parent 9a461a0c16
commit e9d1d20c63
2 changed files with 74 additions and 14 deletions

View File

@@ -52,8 +52,13 @@ func printResults(musicObjects []data.MusicObject) {
}
}
for _, source := range m.GetSources() {
results[i] += "\n\t- " + source.Url
sources := m.GetSources()
if len(sources) > 0 {
for _, source := range sources {
results[i] += "\n\t- " + source.Url
}
} else {
results[i] = color.StrikeThrough + results[i] + color.Reset
}
}

View File

@@ -1,23 +1,66 @@
package color
import (
"fmt"
"runtime"
)
var Reset = "\033[0m"
var Red = "\033[31m"
var Green = "\033[32m"
var Yellow = "\033[33m"
var Blue = "\033[34m"
var Purple = "\033[35m"
var Cyan = "\033[36m"
var Gray = "\033[37m"
var White = "\033[97m"
var (
Reset = "\033[0m"
/////////////
// Special //
/////////////
Bold = "\033[1m"
Underline = "\033[4m"
StrikeThrough = "\033[9m"
/////////////////
// Text colors //
/////////////////
Black = "\033[30m"
Red = "\033[31m"
Green = "\033[32m"
Yellow = "\033[33m"
Blue = "\033[34m"
Purple = "\033[35m"
Cyan = "\033[36m"
Gray = "\033[37m"
White = "\033[97m"
///////////////////////
// Background colors //
///////////////////////
BlackBackground = "\033[40m"
RedBackground = "\033[41m"
GreenBackground = "\033[42m"
YellowBackground = "\033[43m"
BlueBackground = "\033[44m"
PurpleBackground = "\033[45m"
CyanBackground = "\033[46m"
GrayBackground = "\033[47m"
WhiteBackground = "\033[107m"
)
func init() {
if runtime.GOOS == "windows" {
Reset = ""
/////////////
// Special //
/////////////
Bold = ""
Underline = ""
StrikeThrough = ""
/////////////////
// Text colors //
/////////////////
Black = ""
Red = ""
Green = ""
Yellow = ""
@@ -26,7 +69,19 @@ func init() {
Cyan = ""
Gray = ""
White = ""
}
fmt.Println("init")
///////////////////////
// Background colors //
///////////////////////
BlackBackground = ""
RedBackground = ""
GreenBackground = ""
YellowBackground = ""
BlueBackground = ""
PurpleBackground = ""
CyanBackground = ""
GrayBackground = ""
WhiteBackground = ""
}
}