firmware: add 'sony' category (rsync-style, like rockbox)

- New Firmware::Sony mapped from firmware = "sony"; behaves like
  rockbox/android (rsync to mounted volume, no fatsort)
- Green badge on dashboard; config parsing test included
- Real config: Sony NW-A55 + Walkman WM1 switched to firmware = "sony"
This commit is contained in:
Sebastian
2026-08-22 10:05:34 +02:00
parent 88b53e50d1
commit d1cf5af7fa
3 changed files with 32 additions and 4 deletions
+3 -3
View File
@@ -67,9 +67,9 @@ mount_point = "/media/sebastian/IPOD"
music_folder = "Music"
```
Firmware types: `apple` (podkit command), `rockbox`, `android` (rsync),
`mlove` (rsync + `fatsort`). Devices with `content_type = "hoerspiele"` sync
against the hoerspiele library.
Firmware types: `apple` (podkit command), `rockbox`, `android`, `sony`
(rsync to a mounted volume), `mlove` (rsync + `fatsort`). Devices with
`content_type = "hoerspiele"` sync against the hoerspiele library.
## How the sync pipeline works
+27
View File
@@ -70,6 +70,7 @@ pub enum Firmware {
Rockbox,
Android,
Mlove,
Sony,
}
impl Firmware {
@@ -78,6 +79,7 @@ impl Firmware {
"rockbox" => Firmware::Rockbox,
"android" => Firmware::Android,
"mlove" => Firmware::Mlove,
"sony" => Firmware::Sony,
_ => Firmware::Apple,
}
}
@@ -87,6 +89,7 @@ impl Firmware {
Firmware::Rockbox => "rockbox",
Firmware::Android => "android",
Firmware::Mlove => "mlove",
Firmware::Sony => "sony",
}
}
}
@@ -375,4 +378,28 @@ music_folder = "Music"
assert_eq!(cfg.storagebox_excludes, vec![".DS_Store"]);
assert_eq!(cfg.local_music_dir, dirs::home_dir().unwrap().join("Music"));
}
#[test]
fn loads_sony_firmware_as_rockbox_style() {
let dir = std::env::temp_dir().join("dap-tui-sony-test");
let _ = std::fs::create_dir_all(&dir);
let path = dir.join("config.toml");
std::fs::write(
&path,
r#"
[[devices]]
name = "Sony NW-A55"
firmware = "sony"
mount_point = "/media/SD_CARD"
music_folder = "MUSIC"
"#,
)
.unwrap();
let cfg = load(Some(path.display().to_string())).unwrap();
assert_eq!(cfg.devices.len(), 1);
let d = &cfg.devices[0];
assert_eq!(d.firmware, Firmware::Sony);
assert_eq!(d.music_folder, "MUSIC");
assert_eq!(d.preserve_fat_order, false);
}
}
+2 -1
View File
@@ -33,7 +33,8 @@ fn firmware_color(fw: &Firmware) -> ratatui::style::Color {
Firmware::Rockbox => theme::MAGENTA,
Firmware::Android => theme::CYAN,
Firmware::Mlove => theme::ORANGE,
Firmware::Apple => theme::GREEN,
Firmware::Sony => theme::GREEN,
Firmware::Apple => theme::YELLOW,
}
}