Compare commits
2 commits
d765fa82f8
...
49fe76823e
Author | SHA1 | Date | |
---|---|---|---|
49fe76823e | |||
180dd9891a |
4 changed files with 15908 additions and 10 deletions
|
@ -2,6 +2,12 @@
|
||||||
|
|
||||||
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
|
||||||
|
|
|
@ -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 subscriber_count = hdata
|
let md_rows = hdata.metadata.content_metadata_view_model.metadata_rows;
|
||||||
.metadata
|
let sub_part = if md_rows.len() > 1 {
|
||||||
.content_metadata_view_model
|
md_rows.get(1).and_then(|md| md.metadata_parts.first())
|
||||||
.metadata_rows
|
} else {
|
||||||
.first()
|
md_rows.first().and_then(|md| md.metadata_parts.get(1))
|
||||||
.and_then(|md| {
|
};
|
||||||
md.metadata_parts.get(1).and_then(|t| {
|
let subscriber_count = sub_part.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,6 +720,7 @@ 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
14558
testfiles/channel/channel_videos_20240324_pageheader2.json
Normal file
14558
testfiles/channel/channel_videos_20240324_pageheader2.json
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue