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:
Deluan 2026-07-18 02:18:52 -04:00
commit d509d8b2f8
6 changed files with 32 additions and 6 deletions

View file

@ -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