Altersangaben: Genre-Signal-Chip (Kinder/Jugend aus Audible-Genres) + manuelle Altersnote pro Buch (labels.json, Inline-Edit mit Stift-Button)

This commit is contained in:
2026-11-06 20:20:51 +01:00
parent 14b93e2fb1
commit 0b7e223ad5
7 changed files with 162 additions and 2 deletions

View File

@ -730,6 +730,23 @@ mod tests {
let _ = fs::remove_dir_all(&root);
}
#[test]
fn alter_note_roundtrip() {
let tmp = std::env::temp_dir().join(format!("hw-labels-{}", std::process::id()));
unsafe {
std::env::set_var("HOERWERK_BOOKS_DIR", &tmp);
}
crate::audible::set_alter_note("B08L4WJMDM", Some("ab 6".into())).unwrap();
let l = crate::audible::alter_notes();
assert_eq!(l.0.get("B08L4WJMDM").map(|s| s.as_str()), Some("ab 6"));
crate::audible::set_alter_note("B08L4WJMDM", None).unwrap();
assert!(crate::audible::alter_notes().0.get("B08L4WJMDM").is_none());
unsafe {
std::env::remove_var("HOERWERK_BOOKS_DIR");
}
let _ = fs::remove_dir_all(&tmp);
}
#[test]
fn dl_item_serde_status() {
let it = DlItem {