From c27c1f9510ab0a8991a871442de1c5c378f4ac32 Mon Sep 17 00:00:00 2001 From: dschlueter Date: Wed, 18 Feb 2026 11:12:48 +0100 Subject: [PATCH] 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 --- src/musiksammlung/cli.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/musiksammlung/cli.py b/src/musiksammlung/cli.py index fabd871..1c2b98c 100644 --- a/src/musiksammlung/cli.py +++ b/src/musiksammlung/cli.py @@ -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)