refactor: simplify error handling in updateParticipants and toModels methods
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -203,12 +203,11 @@ func (r *albumRepository) Put(al *model.Album) error {
|
|||||||
}
|
}
|
||||||
al.ID = id
|
al.ID = id
|
||||||
if len(al.Participants) > 0 {
|
if len(al.Participants) > 0 {
|
||||||
err = r.updateParticipants(al.ID, al.Participants)
|
if err = r.updateParticipants(al.ID, al.Participants); err != nil {
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return err
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Move external metadata to a separated table
|
// TODO Move external metadata to a separated table
|
||||||
@@ -242,7 +241,7 @@ func (r *albumRepository) GetAll(options ...model.QueryOptions) (model.Albums, e
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return res.toModels(), err
|
return res.toModels(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *albumRepository) CopyAttributes(fromID, toID string, columns ...string) error {
|
func (r *albumRepository) CopyAttributes(fromID, toID string, columns ...string) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user