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:
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user