pretty shell
This commit is contained in:
@@ -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"))
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user