fix(core): waive untagged audio on main roots (#282)
This commit was merged in pull request #282.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user