pretty shell
This commit is contained in:
@@ -49,6 +49,10 @@ func printResults(musicObjects []data.MusicObject) {
|
|||||||
results[i] += " - " + artist.Name
|
results[i] += " - " + artist.Name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, source := range m.GetSources() {
|
||||||
|
results[i] += "\n\t- " + source.Url
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(strings.Join(results, "\n"))
|
fmt.Println(strings.Join(results, "\n"))
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type MusicObject interface {
|
type MusicObject interface {
|
||||||
|
GetSources() []Source
|
||||||
Compile() MusicObject
|
Compile() MusicObject
|
||||||
GetIndices() []string
|
GetIndices() []string
|
||||||
Merge(other MusicObject) MusicObject
|
Merge(other MusicObject) MusicObject
|
||||||
@@ -70,6 +71,10 @@ type Song struct {
|
|||||||
Sources []Source
|
Sources []Source
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m Song) GetSources() []Source {
|
||||||
|
return m.Sources
|
||||||
|
}
|
||||||
|
|
||||||
func (m Song) GetIndices() []string {
|
func (m Song) GetIndices() []string {
|
||||||
res := sourceIndices(m.Sources)
|
res := sourceIndices(m.Sources)
|
||||||
if m.UnifiedName != "" {
|
if m.UnifiedName != "" {
|
||||||
@@ -122,6 +127,10 @@ type Album struct {
|
|||||||
Sources []Source
|
Sources []Source
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m Album) GetSources() []Source {
|
||||||
|
return m.Sources
|
||||||
|
}
|
||||||
|
|
||||||
func (m Album) GetIndices() []string {
|
func (m Album) GetIndices() []string {
|
||||||
res := sourceIndices(m.Sources)
|
res := sourceIndices(m.Sources)
|
||||||
if m.UnifiedName != "" {
|
if m.UnifiedName != "" {
|
||||||
@@ -174,6 +183,10 @@ type Artist struct {
|
|||||||
Sources []Source
|
Sources []Source
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m Artist) GetSources() []Source {
|
||||||
|
return m.Sources
|
||||||
|
}
|
||||||
|
|
||||||
func (m Artist) Merge(other MusicObject) MusicObject {
|
func (m Artist) Merge(other MusicObject) MusicObject {
|
||||||
otherArtist, ok := other.(Artist)
|
otherArtist, ok := other.(Artist)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|||||||
Reference in New Issue
Block a user