pretty shell

This commit is contained in:
Hazel Noack
2025-10-08 13:19:30 +02:00
parent 043f5e9b55
commit 3dd03491ca
2 changed files with 17 additions and 0 deletions

View File

@@ -49,6 +49,10 @@ func printResults(musicObjects []data.MusicObject) {
results[i] += " - " + artist.Name
}
}
for _, source := range m.GetSources() {
results[i] += "\n\t- " + source.Url
}
}
fmt.Println(strings.Join(results, "\n"))

View File

@@ -7,6 +7,7 @@ import (
)
type MusicObject interface {
GetSources() []Source
Compile() MusicObject
GetIndices() []string
Merge(other MusicObject) MusicObject
@@ -70,6 +71,10 @@ type Song struct {
Sources []Source
}
func (m Song) GetSources() []Source {
return m.Sources
}
func (m Song) GetIndices() []string {
res := sourceIndices(m.Sources)
if m.UnifiedName != "" {
@@ -122,6 +127,10 @@ type Album struct {
Sources []Source
}
func (m Album) GetSources() []Source {
return m.Sources
}
func (m Album) GetIndices() []string {
res := sourceIndices(m.Sources)
if m.UnifiedName != "" {
@@ -174,6 +183,10 @@ type Artist struct {
Sources []Source
}
func (m Artist) GetSources() []Source {
return m.Sources
}
func (m Artist) Merge(other MusicObject) MusicObject {
otherArtist, ok := other.(Artist)
if !ok {