Compare commits

..

No commits in common. "49fe76823e24892eaee50502b661c8ef89c33d51" and "d765fa82f88437e3476c8094db6846132b2d2ab7" have entirely different histories.

4 changed files with 10 additions and 15908 deletions

View file

@ -2,12 +2,6 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [v0.1.2](https://code.thetadev.de/ThetaDev/rustypipe/compare/rustypipe/v0.1.1..v0.1.2) - 2024-03-26
### 🐛 Bug Fixes
- Correctly parse subscriber count with new channel header - ([180dd98](https://code.thetadev.de/ThetaDev/rustypipe/commit/180dd9891a14b4da9f130a73d73aecc3822fce2f))
## [v0.1.1](https://code.thetadev.de/ThetaDev/rustypipe/compare/rustypipe-cli/v0.1.0..v0.1.1) - 2024-03-26 ## [v0.1.1](https://code.thetadev.de/ThetaDev/rustypipe/compare/rustypipe-cli/v0.1.0..v0.1.1) - 2024-03-26
### 🐛 Bug Fixes ### 🐛 Bug Fixes

View file

@ -480,16 +480,16 @@ fn map_channel(
response::channel::Header::PageHeaderRenderer(header) => { response::channel::Header::PageHeaderRenderer(header) => {
let hdata = header.content.page_header_view_model; let hdata = header.content.page_header_view_model;
// channel handle - subscriber count - video count // channel handle - subscriber count - video count
let md_rows = hdata.metadata.content_metadata_view_model.metadata_rows; let subscriber_count = hdata
let sub_part = if md_rows.len() > 1 { .metadata
md_rows.get(1).and_then(|md| md.metadata_parts.first()) .content_metadata_view_model
} else { .metadata_rows
md_rows.first().and_then(|md| md.metadata_parts.get(1)) .first()
}; .and_then(|md| {
let subscriber_count = sub_part.and_then(|t| { md.metadata_parts.get(1).and_then(|t| {
util::parse_large_numstr_or_warn::<u64>(&t.text, lang, &mut warnings) util::parse_large_numstr_or_warn::<u64>(&t.text, lang, &mut warnings)
})
}); });
Channel { Channel {
id: metadata.external_id, id: metadata.external_id,
name: metadata.title, name: metadata.title,
@ -720,7 +720,6 @@ mod tests {
#[case::shorts("shorts", "UCh8gHdtzO2tXd593_bjErWg")] #[case::shorts("shorts", "UCh8gHdtzO2tXd593_bjErWg")]
#[case::livestreams("livestreams", "UC2DjFE7Xf11URZqWBigcVOQ")] #[case::livestreams("livestreams", "UC2DjFE7Xf11URZqWBigcVOQ")]
#[case::pageheader("shorts_20240129_pageheader", "UCh8gHdtzO2tXd593_bjErWg")] #[case::pageheader("shorts_20240129_pageheader", "UCh8gHdtzO2tXd593_bjErWg")]
#[case::pageheader2("videos_20240324_pageheader2", "UC2DjFE7Xf11URZqWBigcVOQ")]
fn map_channel_videos(#[case] name: &str, #[case] id: &str) { fn map_channel_videos(#[case] name: &str, #[case] id: &str) {
let json_path = path!(*TESTFILES / "channel" / format!("channel_{name}.json")); let json_path = path!(*TESTFILES / "channel" / format!("channel_{name}.json"));
let json_file = File::open(json_path).unwrap(); let json_file = File::open(json_path).unwrap();

File diff suppressed because it is too large Load diff