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,9 +52,14 @@ func printResults(musicObjects []data.MusicObject) {
} }
} }
for _, source := range m.GetSources() { sources := m.GetSources()
if len(sources) > 0 {
for _, source := range sources {
results[i] += "\n\t- " + source.Url results[i] += "\n\t- " + source.Url
} }
} else {
results[i] = color.StrikeThrough + results[i] + color.Reset
}
} }
fmt.Println() fmt.Println()

View File

@@ -1,23 +1,66 @@
package color package color
import ( import (
"fmt"
"runtime" "runtime"
) )
var Reset = "\033[0m" var (
var Red = "\033[31m" Reset = "\033[0m"
var Green = "\033[32m"
var Yellow = "\033[33m" /////////////
var Blue = "\033[34m" // Special //
var Purple = "\033[35m" /////////////
var Cyan = "\033[36m"
var Gray = "\033[37m" Bold = "\033[1m"
var White = "\033[97m" 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() { func init() {
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
Reset = "" Reset = ""
/////////////
// Special //
/////////////
Bold = ""
Underline = ""
StrikeThrough = ""
/////////////////
// Text colors //
/////////////////
Black = ""
Red = "" Red = ""
Green = "" Green = ""
Yellow = "" Yellow = ""
@@ -26,7 +69,19 @@ func init() {
Cyan = "" Cyan = ""
Gray = "" Gray = ""
White = "" White = ""
}
fmt.Println("init") ///////////////////////
// Background colors //
///////////////////////
BlackBackground = ""
RedBackground = ""
GreenBackground = ""
YellowBackground = ""
BlueBackground = ""
PurpleBackground = ""
CyanBackground = ""
GrayBackground = ""
WhiteBackground = ""
}
} }