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

View file

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