mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-28 14:17:10 +01:00
fix: correct updated_at assignment in library repository
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
7fbf6c6382
commit
8a0017a186
1 changed files with 2 additions and 2 deletions
|
|
@ -82,10 +82,10 @@ func (r *libraryRepository) Put(l *model.Library) error {
|
|||
}
|
||||
|
||||
var err error
|
||||
l.UpdatedAt = time.Now()
|
||||
if l.ID == 0 {
|
||||
// Insert with autoassigned ID
|
||||
l.CreatedAt = time.Now()
|
||||
l.UpdatedAt = time.Now()
|
||||
err = r.db.Model(l).Insert()
|
||||
} else {
|
||||
// Try to update first
|
||||
|
|
@ -94,7 +94,7 @@ func (r *libraryRepository) Put(l *model.Library) error {
|
|||
"path": l.Path,
|
||||
"remote_path": l.RemotePath,
|
||||
"default_new_users": l.DefaultNewUsers,
|
||||
"updated_at": time.Now(),
|
||||
"updated_at": l.UpdatedAt,
|
||||
}
|
||||
sq := Update(r.tableName).SetMap(cols).Where(Eq{"id": l.ID})
|
||||
rowsAffected, updateErr := r.executeSQL(sq)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue