fix: information panels (ÖRR, Covid, ...)

This commit is contained in:
ThetaDev 2022-09-20 21:47:22 +02:00
parent 584d6aa3f5
commit 3596861b77
2 changed files with 5 additions and 2 deletions

View file

@ -99,7 +99,7 @@ pub enum VideoResultsItem {
///
/// 1. sectionIdentifier: "comments-entry-point", contains number of comments
/// 2. sectionIdentifier: "comment-item-section", contains continuation token
ItemSectionRenderer(ItemSection),
ItemSectionRenderer(#[serde_as(deserialize_as = "DefaultOnError")] ItemSection),
#[serde(other, deserialize_with = "ignore_any")]
None,
}
@ -232,7 +232,7 @@ pub struct CurrentVideoWatchEndpoint {
/// 1. CommentsEntryPointHeaderRenderer: contains number of comments
/// 2. ContinuationItemRenderer: contains continuation token
#[serde_as]
#[derive(Clone, Debug, Deserialize)]
#[derive(Default, Clone, Debug, Deserialize)]
#[serde(rename_all = "kebab-case", tag = "sectionIdentifier")]
pub enum ItemSection {
CommentsEntryPoint {
@ -243,6 +243,8 @@ pub enum ItemSection {
#[serde_as(as = "VecSkipError<_>")]
contents: Vec<ItemSectionComments>,
},
#[default]
None,
}
/// Item section containing comment count

View file

@ -133,6 +133,7 @@ impl MapResponse<VideoDetails> for response::VideoDetails {
response::video_details::ItemSection::CommentItemSection { mut contents } => {
comment_ctoken_section = contents.try_swap_remove(0);
}
response::video_details::ItemSection::None => {},
}
}
response::video_details::VideoResultsItem::None => {}