Find cover in parent directory when album_dir is a CD subdirectory

When applying in-place with input_dir=CD1, cover files naturally live
in the album root (parent). Fall back to searching the parent when
album_dir matches the CD\d+ pattern and no cover is found in-place.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dieter Schlüter 2026-02-18 11:12:48 +01:00
commit c27c1f9510

View file

@ -299,6 +299,9 @@ def apply(
tag_album(album, album_dir)
copy_covers(front, back, album_dir)
cover = find_cover(album_dir)
# Bei in-place mit CD-Unterverzeichnis auch im Album-Root nach Cover suchen
if cover is None and _CD_SUBDIR.match(album_dir.resolve().name):
cover = find_cover(album_dir.resolve().parent)
if cover:
typer.echo(f"Bette Cover ein ({cover.name})...")
embed_album_cover(album, album_dir, cover)