Fix album.json landing in wrong directory
album.json was written to a separately computed album_root that could differ from the actual disc_dir parent (e.g. when CDDB returned a different album name). Now album.json is always saved in disc_dir.parent where the audio files actually reside. Also adopts CDDB album name when the user accepted the default name. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cf836b4528
commit
de12afa67a
2 changed files with 21 additions and 8 deletions
|
|
@ -455,7 +455,7 @@ class TestInteractiveRipBarcode:
|
|||
assert (tmp_path / "Abbey_Road" / "album.json").exists()
|
||||
|
||||
def test_manual_album_name_kept_when_not_default(self, tmp_path: Path) -> None:
|
||||
"""Manuell eingegebener Albumname wird NICHT von MusicBrainz überschrieben."""
|
||||
"""Manuell eingegebener Albumname → album.json liegt im manuellen Verzeichnis."""
|
||||
inputs = [
|
||||
"Mein Album", # manuell eingegebener Name
|
||||
"0602557360561", # EAN
|
||||
|
|
@ -472,6 +472,10 @@ class TestInteractiveRipBarcode:
|
|||
):
|
||||
interactive_rip(config)
|
||||
|
||||
# JSON-Inhalt kommt von MusicBrainz (artist/year), aber das Verzeichnis-Layout
|
||||
# richtet sich nach mb_album.album (da MB-Daten Priorität haben)
|
||||
assert (tmp_path / "Abbey_Road" / "album.json").exists()
|
||||
# album.json liegt im Verzeichnis mit dem manuellen Namen (dort liegen die Dateien),
|
||||
# Inhalt stammt aber aus MusicBrainz
|
||||
json_path = tmp_path / "Mein_Album" / "album.json"
|
||||
assert json_path.exists()
|
||||
import json
|
||||
data = json.loads(json_path.read_text())
|
||||
assert data["artist"] == "The Beatles"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue