mirror of
https://github.com/gabehf/Koito.git
synced 2026-04-23 04:21:51 -07:00
feat: search/merge items by id
This commit is contained in:
parent
5537b6fb89
commit
1425f7f416
9 changed files with 752 additions and 46 deletions
|
|
@ -2,6 +2,7 @@ package psql
|
|||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
|
@ -34,6 +35,10 @@ func (d *Psql) GetTrack(ctx context.Context, opts db.GetTrackOpts) (*models.Trac
|
|||
Image: t.Image,
|
||||
Duration: t.Duration,
|
||||
}
|
||||
err = json.Unmarshal(t.Artists, &track.Artists)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("GetTrack: json.Unmarshal: %w", err)
|
||||
}
|
||||
} else if opts.MusicBrainzID != uuid.Nil {
|
||||
l.Debug().Msgf("Fetching track from DB with MusicBrainz ID %s", opts.MusicBrainzID)
|
||||
t, err := d.q.GetTrackByMbzID(ctx, &opts.MusicBrainzID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue