From 3dd03491cade7502e26610706445b407351ab289 Mon Sep 17 00:00:00 2001 From: Hazel Noack Date: Wed, 8 Oct 2025 13:19:30 +0200 Subject: [PATCH] pretty shell --- internal/cli/shell.go | 4 ++++ internal/data/song.go | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/internal/cli/shell.go b/internal/cli/shell.go index d6b3cdf..40b316f 100644 --- a/internal/cli/shell.go +++ b/internal/cli/shell.go @@ -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")) diff --git a/internal/data/song.go b/internal/data/song.go index d5c6b69..341a3d5 100644 --- a/internal/data/song.go +++ b/internal/data/song.go @@ -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 {