fix(core): waive untagged audio on main roots (#282)
ci / web (push) Successful in 42s
e2e / e2e (push) Successful in 2m6s
ci / rust (push) Successful in 2m50s
ci / image (push) Successful in 3m23s

This commit was merged in pull request #282.
This commit is contained in:
2026-11-15 13:22:29 +00:00
parent 5a18facc4f
commit 9adbca3acd
9 changed files with 69 additions and 29 deletions
+3 -5
View File
@@ -165,14 +165,13 @@ impl FakeQbit {
.torrents()
.into_iter()
.find(|torrent| torrent.hash.eq_ignore_ascii_case(&hash))
.map(|torrent| {
.map_or_default(|torrent| {
torrent
.files
.into_iter()
.map(|(path, size)| json!({"name": path, "size": size}))
.collect()
})
.unwrap_or_default();
});
ResponseTemplate::new(200).set_body_json(files)
}
@@ -281,8 +280,7 @@ fn decode(input: &str) -> String {
fn text(parts: &HashMap<String, Vec<u8>>, key: &str) -> String {
parts
.get(key)
.map(|bytes| String::from_utf8_lossy(bytes).into_owned())
.unwrap_or_default()
.map_or_default(|bytes| String::from_utf8_lossy(bytes).into_owned())
}
/// The named parts of a `multipart/form-data` body.