mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-15 18:35:55 -07:00
feat: listenbrainz import
This commit is contained in:
parent
63517c0a03
commit
d0d7bd9a4a
9 changed files with 248 additions and 6 deletions
|
|
@ -57,10 +57,14 @@ func (m *MbzMockCaller) GetTrack(ctx context.Context, id uuid.UUID) (*MusicBrain
|
|||
}
|
||||
|
||||
func (m *MbzMockCaller) GetArtistPrimaryAliases(ctx context.Context, id uuid.UUID) ([]string, error) {
|
||||
name := m.Artists[id].Name
|
||||
ss := make([]string, len(m.Artists[id].Aliases)+1)
|
||||
artist, exists := m.Artists[id]
|
||||
if !exists {
|
||||
return nil, fmt.Errorf("artist with ID %s not found", id)
|
||||
}
|
||||
name := artist.Name
|
||||
ss := make([]string, len(artist.Aliases)+1)
|
||||
ss[0] = name
|
||||
for i, alias := range m.Artists[id].Aliases {
|
||||
for i, alias := range artist.Aliases {
|
||||
ss[i+1] = alias.Name
|
||||
}
|
||||
return ss, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue