mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-16 02:45:54 -07:00
fix: set first artist listed as primary by default (#81)
This commit is contained in:
parent
cd31b6f2d8
commit
70f5198781
17 changed files with 46 additions and 26 deletions
|
|
@ -132,8 +132,9 @@ func (d *Psql) SaveTrack(ctx context.Context, opts db.SaveTrackOpts) (*models.Tr
|
|||
// insert associated artists
|
||||
for _, aid := range opts.ArtistIDs {
|
||||
err = qtx.AssociateArtistToTrack(ctx, repository.AssociateArtistToTrackParams{
|
||||
ArtistID: aid,
|
||||
TrackID: trackRow.ID,
|
||||
ArtistID: aid,
|
||||
TrackID: trackRow.ID,
|
||||
IsPrimary: opts.ArtistIDs[0] == aid,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("SaveTrack: AssociateArtistToTrack: %w", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue