fix(library): MBID backfills skip tracks whose files are missing (#5139)
release / govulncheck (push) Successful in 37s
release / web (push) Successful in 1m13s
release / go (push) Successful in 1m34s
release / integration (push) Successful in 4m55s
release / android (push) Successful in 6m22s
release / Build signed APK (releases and dev) (push) Successful in 6m39s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 1m53s
release / Verify release artifacts (tag releases only) (push) Skipped
release / govulncheck (push) Successful in 37s
release / web (push) Successful in 1m13s
release / go (push) Successful in 1m34s
release / integration (push) Successful in 4m55s
release / android (push) Successful in 6m22s
release / Build signed APK (releases and dev) (push) Successful in 6m39s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 1m53s
release / Verify release artifacts (tag releases only) (push) Skipped
The track backfill listed every track with a NULL mbid, missing or not, so each scan tried to open every missing file and logged an "open failed" warning per track. Nothing ever healed. The album backfill could pick a missing track as the one to read, and since that pass is capped per scan, albums stuck that way were retried ahead of the rest every time. Both now read only tracks still on disk; an album with none left is skipped until a scan finds its files again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -552,6 +552,7 @@ SELECT a.id AS album_id,
|
||||
SELECT file_path
|
||||
FROM tracks
|
||||
WHERE album_id = a.id
|
||||
AND missing_since IS NULL
|
||||
ORDER BY disc_number NULLS LAST, track_number NULLS LAST, id
|
||||
LIMIT 1
|
||||
) t ON true
|
||||
@@ -569,7 +570,9 @@ type ListAlbumsMissingMbidWithTrackRow struct {
|
||||
|
||||
// One-shot MBID backfill: returns each album where mbid IS NULL alongside
|
||||
// one of its tracks' file_path so the worker can re-read tags. LIMIT
|
||||
// supplied by caller for batching/progress purposes.
|
||||
// supplied by caller for batching/progress purposes. The track read is
|
||||
// one still on disk; an album with none left is skipped until a scan
|
||||
// finds its files again (#5139).
|
||||
func (q *Queries) ListAlbumsMissingMbidWithTrack(ctx context.Context, limit int32) ([]ListAlbumsMissingMbidWithTrackRow, error) {
|
||||
rows, err := q.db.Query(ctx, listAlbumsMissingMbidWithTrack, limit)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user