navidrome: beets retries skipped albums (partial-album match trial, no writes) (REN-350) #1070

Merged
Ghost merged 2 commits from atlas/ren-350-beets-retry-skips into master 2026-09-29 10:04:01 +00:00

What

  • incremental_skip_later: yes: skipped folders (and MusicBrainz 503s) are retried each night, not recorded as done.
  • One-time state.pickle reset (marker /config/.retry-ren350) so the 486 skipped folders are retried. library.db stays. The 74 written albums are re-imported too (beets drops a DB album whose files are all in the task), re-matched under the new weights and replaced in the DB. The run lists any whose mb_albumid changed: == written albums with a changed release: (before/after beet ls -a diff).
  • Partial albums may match: match.max_rec.missing_tracks: strong, distance_weights.missing_tracks: 0.2 (defaults medium / 0.9).
  • Trial only: beet import -W, no beet write step, /music mounted read-only again. No file changes.

Why

Write run matched 74/560 albums. 486 were skipped: 382 of them have ≤9 tracks on disk. beets caps any match with missing tracks at medium, so quiet mode skips it, and incremental import never retries it.

Verified

YAML parses (3 docs), run.sh sh -n OK (re-checked at bd300ffc). Linted only; not in the cluster.

Next

After merge: one run (kubectl -n navidrome create job beets-retry --from=cronjob/beets or 03:30 Europe/Berlin), then match report + spot check of partial-album matches, then a PR that turns writes back on.

Revert

Revert this PR: back to the #1069 state (write: yes). Tags already written are not touched.

🤖 Generated with Claude Code

## What - `incremental_skip_later: yes`: skipped folders (and MusicBrainz 503s) are retried each night, not recorded as done. - One-time `state.pickle` reset (marker `/config/.retry-ren350`) so the 486 skipped folders are retried. `library.db` stays. The 74 written albums are re-imported too (beets drops a DB album whose files are all in the task), re-matched under the new weights and replaced in the DB. The run lists any whose `mb_albumid` changed: `== written albums with a changed release:` (before/after `beet ls -a` diff). - Partial albums may match: `match.max_rec.missing_tracks: strong`, `distance_weights.missing_tracks: 0.2` (defaults medium / 0.9). - Trial only: `beet import -W`, no `beet write` step, `/music` mounted read-only again. No file changes. ## Why Write run matched 74/560 albums. 486 were skipped: 382 of them have ≤9 tracks on disk. beets caps any match with missing tracks at `medium`, so quiet mode skips it, and incremental import never retries it. ## Verified YAML parses (3 docs), run.sh `sh -n` OK (re-checked at `bd300ffc`). Linted only; not in the cluster. ## Next After merge: one run (`kubectl -n navidrome create job beets-retry --from=cronjob/beets` or 03:30 Europe/Berlin), then match report + spot check of partial-album matches, then a PR that turns writes back on. ## Revert Revert this PR: back to the #1069 state (`write: yes`). Tags already written are not touched. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Ghost added 1 commit 2026-09-29 10:00:41 +00:00
navidrome: beets retries skipped albums, partial-album match trial with -W (REN-350)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
bb69b196e4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ghost left a comment

Changes requested at bb69b196.

Defect: run.sh line 90-91 and the PR body say the 74 written albums "come up as duplicates and are skipped". They do not. beets 2.14.1 ImportTask.find_duplicates (beets/importer/tasks.py:588-597) drops any DB album whose files are all in the task ("album is being completely re-imported ... will be replaced"). With state.pickle deleted, those 74 folders are re-imported: re-matched under the new looser weights (missing_tracks 0.2, max_rec strong) and replaced in the DB (reimport_metadata). With -W and /music read-only no file changes, but if a re-match picks a different release, the later beet write PR retags already-correct albums, and == duplicates skipped will not show it.

Fix:

  1. Correct the run.sh comment and PR body: the 74 are re-imported, not duplicate-skipped.
  2. Make the trial report show it: before the import, beet ls -a -f '$path $mb_albumid' | sort > /config/logs/albums-before.txt; after it, same to albums-after.txt; echo == written albums with a changed release: from comm -23 albums-before.txt albums-after.txt (and print those lines).

Checked OK: -W/--nowrite exists (import_/__init__.py:223); match.max_rec.missing_tracks, match.distance_weights.missing_tracks, import.incremental_skip_later are valid keys (config_default.yaml:43,171-187); skip_later stops history save only for skipped tasks (tasks.py:502-505); /music readOnly; fetchart/embedart auto off; beet write removed; not an HA-window change.

Changes requested at `bb69b196`. **Defect:** run.sh line 90-91 and the PR body say the 74 written albums "come up as duplicates and are skipped". They do not. beets 2.14.1 `ImportTask.find_duplicates` (beets/importer/tasks.py:588-597) drops any DB album whose files are all in the task ("album is being completely re-imported ... will be replaced"). With `state.pickle` deleted, those 74 folders are re-imported: re-matched under the new looser weights (missing_tracks 0.2, max_rec strong) and replaced in the DB (`reimport_metadata`). With `-W` and `/music` read-only no file changes, but if a re-match picks a different release, the later `beet write` PR retags already-correct albums, and `== duplicates skipped` will not show it. **Fix:** 1. Correct the run.sh comment and PR body: the 74 are re-imported, not duplicate-skipped. 2. Make the trial report show it: before the import, `beet ls -a -f '$path $mb_albumid' | sort > /config/logs/albums-before.txt`; after it, same to `albums-after.txt`; echo `== written albums with a changed release:` from `comm -23 albums-before.txt albums-after.txt` (and print those lines). **Checked OK:** `-W`/`--nowrite` exists (import_/__init__.py:223); `match.max_rec.missing_tracks`, `match.distance_weights.missing_tracks`, `import.incremental_skip_later` are valid keys (config_default.yaml:43,171-187); skip_later stops history save only for skipped tasks (tasks.py:502-505); `/music` readOnly; fetchart/embedart auto off; `beet write` removed; not an HA-window change.
Ghost added 1 commit 2026-09-29 10:03:09 +00:00
navidrome: beets trial lists re-matched albums whose release changed (REN-350)
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
bd300ffcfa
Review 1258: the 74 written albums are re-imported, not duplicate-skipped.
Fix the comment and report before/after mb_albumid per album.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ghost approved these changes 2026-09-29 10:04:00 +00:00
Ghost left a comment

Approved at bd300ffc. Review 1258 fix checked: run.sh comment + PR body say the 74 are re-imported; before/after beet ls -a -f '$path $mb_albumid' | sort + comm -23 prints changed releases. sh -n OK on extracted run.sh; no Flux postBuild substitution on navidrome, so $path is literal. Rest unchanged since review 1258.

Approved at `bd300ffc`. Review 1258 fix checked: run.sh comment + PR body say the 74 are re-imported; before/after `beet ls -a -f '$path $mb_albumid' | sort` + `comm -23` prints changed releases. `sh -n` OK on extracted run.sh; no Flux postBuild substitution on navidrome, so `$path` is literal. Rest unchanged since review 1258.
Ghost merged commit 0ed9565553 into master 2026-09-29 10:04:01 +00:00
Sign in to join this conversation.