improve song title editing

This commit is contained in:
2026-03-03 01:31:52 -08:00
parent f7baf2ee40
commit ace5205724
3 changed files with 20 additions and 12 deletions

View File

@@ -451,6 +451,12 @@ func UpdateSong(id int, title string, durationMs int, spotifyId, musicbrainzId s
_, err := Pool.Exec(context.Background(),
`UPDATE songs SET title = $1, duration_ms = $2, spotify_id = $3, musicbrainz_id = $4 WHERE id = $5`,
title, durationMs, spotifyId, musicbrainzId, id)
if err != nil {
return err
}
_, err = Pool.Exec(context.Background(),
`UPDATE history SET song_name = $1 WHERE song_id = $2`,
title, id)
return err
}