navidrome: beets writes the retried partial-album matches, drops one wrong match (REN-350)
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
atlas-bot
2026-09-30 03:02:24 +00:00
co-authored by Claude Opus 5.5
parent 635bd6a02c
commit d95a5e9137
+27 -14
View File
@@ -6,13 +6,12 @@
# 5-album spot check), so beets now writes tags. Art plugins stay off: they
# would add or embed cover files, a separate change.
#
# Retry trial: the write run matched 74 of 560 albums. 486 were skipped: most
# folders hold only part of an album, and beets caps a match with missing
# tracks below "strong", so quiet mode skipped them, and incremental import
# never looked at them again. This trial retries them with a partial-album
# match allowed, but imports with -W (no tag write) and skips `beet write`,
# so no file changes until the new matches are checked. The 74 written albums
# are re-matched too; the run lists any whose release changed.
# Retry: the first write run matched 74 of 560 albums; most skipped folders
# hold only part of an album. Partial-album matches are allowed now (see
# max_rec). A -W trial matched 158 albums, all at 96% or better, and none of
# the 74 written albums changed release, so beets now writes them. Muse "Black
# Holes and Revelations" matched an instrumental release: it is ignored and
# dropped from the DB (DB only, no file change).
#
# Lidarr does not write tags: lidarr-reconcile sets writeAudioTags "no" on
# every pod start (lidarr.yaml), so it cannot undo the beets tags.
@@ -42,6 +41,9 @@ data:
library: /config/library.db
statefile: /config/state.pickle
plugins: [musicbrainz, fetchart, embedart, lastgenre]
# Beets defaults plus folders whose only match is a wrong release.
ignore: ['.*', '*~', 'System Volume Information', 'lost+found',
'Black Holes and Revelations']
# Keep the first-release date in year; reissues must not change it.
original_date: yes
match:
@@ -95,27 +97,39 @@ data:
rm -f /config/state.pickle
touch /config/.retry-ren350
fi
# One-time: the trial stored an instrumental release for this album.
# `rm` without -d drops the DB entry only; the file is not touched.
if [ ! -f /config/.drop-ren350 ]; then
beet rm -a -f 'path:/music/Muse/Black Holes and Revelations'
touch /config/.drop-ren350
fi
beet ls -a -f '$path $mb_albumid' | sort > /config/logs/albums-before.txt
LOG=/config/logs/import-$(date +%Y%m%d-%H%M).log
# Trial: -W stores matches in the DB but writes no file.
beet import -W -l "$LOG" /music
beet import -l "$LOG" /music
rc=$?
beet ls -a -f '$path $mb_albumid' | sort > /config/logs/albums-after.txt
comm -23 /config/logs/albums-before.txt /config/logs/albums-after.txt \
> /config/logs/albums-changed.txt
echo "== import exit $rc"
echo "== written albums with a changed release: $(wc -l < /config/logs/albums-changed.txt)"
echo "== albums with a changed release: $(wc -l < /config/logs/albums-changed.txt)"
cat /config/logs/albums-changed.txt
echo "== albums in library: $(beet ls -a | wc -l)"
echo "== skipped this run: $(grep -c '^skip ' "$LOG")"
echo "== duplicates skipped: $(grep -c '^duplicate-skip ' "$LOG")"
# Trial: preview only. `beet write` comes back once the matches are checked.
# The trial (-W) stored matches in the DB only; `beet write` puts them
# into the files (tags only, no move).
beet write -p > /config/logs/write-preview.txt 2>&1
echo "== items to write: $(grep -vc '^ ' /config/logs/write-preview.txt)"
beet write
wrc=$?
echo "== write exit $wrc"
beet write -p > /config/logs/write-after.txt 2>&1
echo "== items still differing after write: $(grep -vc '^ ' /config/logs/write-after.txt)"
echo "== skipped albums"
grep '^skip ' "$LOG"
echo "== changes the write would make (first 2000 lines)"
echo "== written changes (first 2000 lines)"
head -n 2000 /config/logs/write-preview.txt
[ "$rc" -eq 0 ] && rc=$wrc
exit $rc
---
apiVersion: batch/v1
@@ -171,10 +185,9 @@ spec:
- name: beets-config
mountPath: /etc/beets
readOnly: true
# Read-only for the retry trial; writable again with `beet write`.
# Writable for tag writes; move/copy/delete stay off above.
- name: music
mountPath: /music
readOnly: true
resources:
requests:
cpu: 100m