add(metadata) search also for narrator if same title
This commit is contained in:
@@ -168,3 +168,37 @@ def test_audio_tags_written_on_import(client):
|
||||
assert str(tags["TXXX:SERIES"]) == "Die drei ??? Kids"
|
||||
assert str(tags["TXXX:SERIES-PART"]) == "85"
|
||||
assert str(tags["TRCK"]) == "1/2"
|
||||
|
||||
|
||||
def test_narrator_in_path_and_tags(client):
|
||||
from mutagen.id3 import ID3
|
||||
|
||||
root = client.tmp_path / "library" / "hp"
|
||||
lib_id = client.post("/api/libraries", json={
|
||||
"name": "HP", "media_type": "audiobook", "root_path": str(root),
|
||||
"folder_template": "{Author}/{Title} ({Narrator})", "file_template": "{Title}",
|
||||
}).json()["id"]
|
||||
beck = client.post("/api/requests", json={
|
||||
"library_id": lib_id, "title": "Harry Potter und der Stein der Weisen",
|
||||
"authors": "J.K. Rowling", "narrator": "Rufus Beck",
|
||||
}).json()
|
||||
client.post("/api/requests", json={
|
||||
"library_id": lib_id, "title": "Harry Potter und der Stein der Weisen",
|
||||
"authors": "J.K. Rowling", "narrator": "Felix von Manteuffel",
|
||||
})
|
||||
|
||||
f = client.downloads / "Harry Potter Stein der Weisen (Rufus Beck).mp3"
|
||||
f.write_bytes(b"")
|
||||
items = client.get("/api/import/scan").json()["items"]
|
||||
assert items[0]["suggested_request_id"] == beck["id"]
|
||||
|
||||
resp = client.post("/api/import", json={"items": [{
|
||||
"path": items[0]["path"], "is_dir": False,
|
||||
"files": items[0]["files"], "request_id": beck["id"],
|
||||
}]})
|
||||
assert resp.json()["results"][0]["ok"]
|
||||
dest = (root / "J.K. Rowling"
|
||||
/ "Harry Potter und der Stein der Weisen (Rufus Beck)"
|
||||
/ "Harry Potter und der Stein der Weisen.mp3")
|
||||
assert dest.is_file()
|
||||
assert str(ID3(dest)["TCOM"]) == "Rufus Beck"
|
||||
|
||||
Reference in New Issue
Block a user