mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-08 11:18:41 +01:00
fix(subsonic): expose cover cache-buster on bookmarked songs
GetBookmarks selected media_file.* without the album cover-stamp projection, so bookmarked songs kept emitting the pre-edit coverArt id after a cover upload/delete. With this fourth copy of the projection appearing, extract it into a shared coverArtUpdatedAtCol helper used by all media_file read paths (list, playlist tracks, single playlist track, bookmarks).
This commit is contained in:
parent
a5d3d615d8
commit
d509d8b2f8
6 changed files with 32 additions and 6 deletions
|
|
@ -100,7 +100,9 @@ func (r sqlRepository) GetBookmarks() (model.Bookmarks, error) {
|
|||
user, _ := request.UserFrom(r.ctx)
|
||||
|
||||
idField := r.tableName + ".id"
|
||||
sq := r.newSelect().Columns(r.tableName + ".*")
|
||||
// Only media files are bookmarkable (see dbMediaFiles scan below), so the cover
|
||||
// stamp projection is safe to add here
|
||||
sq := r.newSelect().Columns(r.tableName+".*", coverArtUpdatedAtCol(r.tableName))
|
||||
sq = r.withAnnotation(sq, idField)
|
||||
sq = r.withBookmark(sq, idField).Where(NotEq{bookmarkTable + ".item_id": nil})
|
||||
var mfs dbMediaFiles // TODO Decouple from media_file
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue