test: fix asserts: client version parts, iOS client bitrate

This commit is contained in:
ThetaDev 2024-05-17 18:27:24 +02:00
parent 45b9f2a627
commit 29a7db231a
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6
5 changed files with 25 additions and 24 deletions

View file

@ -1592,9 +1592,11 @@ fn validate_country(country: Country) -> Country {
mod tests {
use super::*;
// 1.20240506.01.00-canary_control_1.20240508.01.01
// 1.20240508.01.01-canary_experiment_1.20240506.01.00
fn get_major_version(version: &str) -> u32 {
let parts = version.split('.').collect::<Vec<_>>();
assert_eq!(parts.len(), 4);
assert!(parts.len() >= 4, "version: {version}");
parts[0].parse().unwrap()
}

View file

@ -476,15 +476,12 @@ impl TryFrom<TextComponent> for crate::model::ChannelId {
match value {
TextComponent::Browse {
text,
page_type,
page_type: PageType::Channel | PageType::Artist,
browse_id,
} => match page_type {
PageType::Channel | PageType::Artist => Ok(crate::model::ChannelId {
id: browse_id,
name: text,
}),
_ => Err(()),
},
} => Ok(crate::model::ChannelId {
id: browse_id,
name: text,
}),
_ => Err(()),
}
}