From 6e77a2198d87809b4e56acc1413569789765b033 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Sat, 29 Oct 2022 00:27:20 +0200 Subject: [PATCH 1/3] feat: add channel info to channel response items --- src/client/channel.rs | 192 +++++---- src/client/response/video_item.rs | 78 ++-- ...annel__tests__map_channel_livestreams.snap | 240 +++++++++-- ...channel__tests__map_channel_playlists.snap | 240 +++++++++-- ...t__channel__tests__map_channel_shorts.snap | 384 +++++++++++++++--- ..._map_channel_videos_20221011_richgrid.snap | 240 +++++++++-- ...map_channel_videos_20221011_richgrid2.snap | 240 +++++++++-- ...annel__tests__map_channel_videos_base.snap | 240 +++++++++-- ...annel__tests__map_channel_videos_live.snap | 168 +++++++- ...nel__tests__map_channel_videos_shorts.snap | 240 +++++++++-- ...l__tests__map_channel_videos_upcoming.snap | 240 +++++++++-- src/model/convert.rs | 64 +++ src/model/mod.rs | 34 +- 13 files changed, 2188 insertions(+), 412 deletions(-) create mode 100644 src/model/convert.rs diff --git a/src/client/channel.rs b/src/client/channel.rs index 53e1ff4..715e4f1 100644 --- a/src/client/channel.rs +++ b/src/client/channel.rs @@ -141,22 +141,50 @@ impl MapResponse>> for response::Channel { _ => None, }; - let v_res = grid.map(|g| map_videos(g, lang)).unwrap_or_default(); + let channel_data = map_channel( + MapChannelData { + header: self.header, + metadata: self.metadata, + microformat: self.microformat, + visitor_data: self.response_context.visitor_data, + has_shorts: content.has_shorts, + has_live: content.has_live, + }, + id, + lang, + )?; + + let v_res = grid + .map(|g| { + let mut mapper = + response::YouTubeListMapper::::with_channel(lang, &channel_data); + mapper.map_response(g); + + MapResult { + c: Paginator::new(None, mapper.items, mapper.ctoken), + warnings: mapper.warnings, + } + }) + .unwrap_or_default(); Ok(MapResult { - c: map_channel( - MapChannelData { - header: self.header, - metadata: self.metadata, - microformat: self.microformat, - visitor_data: self.response_context.visitor_data, - has_shorts: content.has_shorts, - has_live: content.has_live, - content: v_res.c, - }, - id, - lang, - )?, + c: Channel { + id: channel_data.id, + name: channel_data.name, + subscriber_count: channel_data.subscriber_count, + avatar: channel_data.avatar, + verification: channel_data.verification, + description: channel_data.description, + tags: channel_data.tags, + vanity_url: channel_data.vanity_url, + banner: channel_data.banner, + mobile_banner: channel_data.mobile_banner, + tv_banner: channel_data.tv_banner, + has_shorts: channel_data.has_shorts, + has_live: channel_data.has_live, + visitor_data: channel_data.visitor_data, + content: v_res.c, + }, warnings: v_res.warnings, }) } @@ -175,24 +203,50 @@ impl MapResponse>> for response::Channel { _ => None, }; + let channel_data = map_channel( + MapChannelData { + header: self.header, + metadata: self.metadata, + microformat: self.microformat, + visitor_data: self.response_context.visitor_data, + has_shorts: content.has_shorts, + has_live: content.has_live, + }, + id, + lang, + )?; + let p_res = grid - .map(|item| map_playlists(item, lang)) + .map(|g| { + let mut mapper = + response::YouTubeListMapper::::with_channel(lang, &channel_data); + mapper.map_response(g); + + MapResult { + c: Paginator::new(None, mapper.items, mapper.ctoken), + warnings: mapper.warnings, + } + }) .unwrap_or_default(); Ok(MapResult { - c: map_channel( - MapChannelData { - header: self.header, - metadata: self.metadata, - microformat: self.microformat, - visitor_data: self.response_context.visitor_data, - has_shorts: content.has_shorts, - has_live: content.has_live, - content: p_res.c, - }, - id, - lang, - )?, + c: Channel { + id: channel_data.id, + name: channel_data.name, + subscriber_count: channel_data.subscriber_count, + avatar: channel_data.avatar, + verification: channel_data.verification, + description: channel_data.description, + tags: channel_data.tags, + vanity_url: channel_data.vanity_url, + banner: channel_data.banner, + mobile_banner: channel_data.mobile_banner, + tv_banner: channel_data.tv_banner, + has_shorts: channel_data.has_shorts, + has_live: channel_data.has_live, + visitor_data: channel_data.visitor_data, + content: p_res.c, + }, warnings: p_res.warnings, }) } @@ -212,6 +266,19 @@ impl MapResponse> for response::Channel { _ => None, }; + let channel_data = map_channel( + MapChannelData { + header: self.header, + metadata: self.metadata, + microformat: self.microformat, + visitor_data: self.response_context.visitor_data, + has_shorts: content.has_shorts, + has_live: content.has_live, + }, + id, + lang, + )?; + let cinfo = meta .map(|meta| ChannelInfo { create_date: timeago::parse_textual_date_or_warn( @@ -243,50 +310,28 @@ impl MapResponse> for response::Channel { }); Ok(MapResult { - c: map_channel( - MapChannelData { - header: self.header, - metadata: self.metadata, - microformat: self.microformat, - visitor_data: self.response_context.visitor_data, - has_shorts: content.has_shorts, - has_live: content.has_live, - content: cinfo, - }, - id, - lang, - )?, + c: Channel { + id: channel_data.id, + name: channel_data.name, + subscriber_count: channel_data.subscriber_count, + avatar: channel_data.avatar, + verification: channel_data.verification, + description: channel_data.description, + tags: channel_data.tags, + vanity_url: channel_data.vanity_url, + banner: channel_data.banner, + mobile_banner: channel_data.mobile_banner, + tv_banner: channel_data.tv_banner, + has_shorts: channel_data.has_shorts, + has_live: channel_data.has_live, + visitor_data: channel_data.visitor_data, + content: cinfo, + }, warnings, }) } } -fn map_videos( - res: MapResult>, - lang: Language, -) -> MapResult> { - let mut mapper = response::YouTubeListMapper::::new(lang); - mapper.map_response(res); - - MapResult { - c: Paginator::new(None, mapper.items, mapper.ctoken), - warnings: mapper.warnings, - } -} - -fn map_playlists( - res: MapResult>, - lang: Language, -) -> MapResult> { - let mut mapper = response::YouTubeListMapper::::new(lang); - mapper.map_response(res); - - MapResult { - c: Paginator::new(None, mapper.items, mapper.ctoken), - warnings: mapper.warnings, - } -} - fn map_vanity_url(url: &str, id: &str) -> Option { if url.contains(id) { return None; @@ -299,21 +344,20 @@ fn map_vanity_url(url: &str, id: &str) -> Option { }) } -struct MapChannelData { +struct MapChannelData { header: Option, metadata: Option, microformat: Option, visitor_data: Option, has_shorts: bool, has_live: bool, - content: T, } -fn map_channel( - d: MapChannelData, +fn map_channel( + d: MapChannelData, id: &str, lang: Language, -) -> Result, ExtractionError> { +) -> Result, ExtractionError> { let header = d .header .ok_or(ExtractionError::ContentUnavailable(Cow::Borrowed( @@ -361,7 +405,7 @@ fn map_channel( has_shorts: d.has_shorts, has_live: d.has_live, visitor_data: d.visitor_data, - content: d.content, + content: (), }, response::channel::Header::CarouselHeaderRenderer(carousel) => { let hdata = carousel @@ -398,7 +442,7 @@ fn map_channel( has_shorts: d.has_shorts, has_live: d.has_live, visitor_data: d.visitor_data, - content: d.content, + content: (), } } }) diff --git a/src/client/response/video_item.rs b/src/client/response/video_item.rs index e93b4f4..da245aa 100644 --- a/src/client/response/video_item.rs +++ b/src/client/response/video_item.rs @@ -6,7 +6,7 @@ use time::{Duration, OffsetDateTime}; use super::{ChannelBadge, ContinuationEndpoint, Thumbnails}; use crate::{ - model::{ChannelId, ChannelItem, ChannelTag, PlaylistItem, VideoItem, YouTubeItem}, + model::{Channel, ChannelId, ChannelItem, ChannelTag, PlaylistItem, VideoItem, YouTubeItem}, param::Language, serializer::{ ignore_any, @@ -320,6 +320,8 @@ impl IsShort for Vec { #[derive(Debug)] pub(crate) struct YouTubeListMapper { lang: Language, + channel: Option, + pub items: Vec, pub warnings: Vec, pub ctoken: Option, @@ -330,6 +332,24 @@ impl YouTubeListMapper { pub fn new(lang: Language) -> Self { Self { lang, + channel: None, + items: Vec::new(), + warnings: Vec::new(), + ctoken: None, + corrected_query: None, + } + } + + pub fn with_channel(lang: Language, channel: &Channel) -> Self { + Self { + lang, + channel: Some(ChannelTag { + id: channel.id.to_owned(), + name: channel.name.to_owned(), + avatar: Vec::new(), + verification: channel.verification, + subscriber_count: channel.subscriber_count, + }), items: Vec::new(), warnings: Vec::new(), ctoken: None, @@ -350,20 +370,23 @@ impl YouTubeListMapper { title: video.title, length: length_text.and_then(|txt| util::parse_video_length(&txt)), thumbnail: video.thumbnail.into(), - channel: video.channel.and_then(|c| { - ChannelId::try_from(c).ok().map(|c| ChannelTag { - id: c.id, - name: c.name, - avatar: video - .channel_thumbnail_supported_renderers - .map(|tn| tn.channel_thumbnail_with_link_renderer.thumbnail) - .or(video.channel_thumbnail) - .unwrap_or_default() - .into(), - verification: video.owner_badges.into(), - subscriber_count: None, + channel: video + .channel + .and_then(|c| { + ChannelId::try_from(c).ok().map(|c| ChannelTag { + id: c.id, + name: c.name, + avatar: video + .channel_thumbnail_supported_renderers + .map(|tn| tn.channel_thumbnail_with_link_renderer.thumbnail) + .or(video.channel_thumbnail) + .unwrap_or_default() + .into(), + verification: video.owner_badges.into(), + subscriber_count: None, + }) }) - }), + .or_else(|| self.channel.clone()), publish_date: video .upcoming_event_data .as_ref() @@ -408,7 +431,7 @@ impl YouTubeListMapper { }) }), thumbnail: video.thumbnail.into(), - channel: None, + channel: self.channel.clone(), publish_date: None, publish_date_txt: None, view_count: video @@ -421,7 +444,7 @@ impl YouTubeListMapper { } } - fn map_playlist(playlist: PlaylistRenderer) -> PlaylistItem { + fn map_playlist(&self, playlist: PlaylistRenderer) -> PlaylistItem { PlaylistItem { id: playlist.playlist_id, name: playlist.title, @@ -430,15 +453,18 @@ impl YouTubeListMapper { .or_else(|| playlist.thumbnails.and_then(|mut t| t.try_swap_remove(0))) .unwrap_or_default() .into(), - channel: playlist.channel.and_then(|c| { - ChannelId::try_from(c).ok().map(|c| ChannelTag { - id: c.id, - name: c.name, - avatar: Vec::new(), - verification: playlist.owner_badges.into(), - subscriber_count: None, + channel: playlist + .channel + .and_then(|c| { + ChannelId::try_from(c).ok().map(|c| ChannelTag { + id: c.id, + name: c.name, + avatar: Vec::new(), + verification: playlist.owner_badges.into(), + subscriber_count: None, + }) }) - }), + .or_else(|| self.channel.clone()), video_count: playlist.video_count.or_else(|| { playlist .video_count_short_text @@ -477,7 +503,7 @@ impl YouTubeListMapper { } YouTubeListItem::PlaylistRenderer(playlist) => self .items - .push(YouTubeItem::Playlist(Self::map_playlist(playlist))), + .push(YouTubeItem::Playlist(self.map_playlist(playlist))), YouTubeListItem::ChannelRenderer(channel) => { self.items .push(YouTubeItem::Channel(Self::map_channel(channel))); @@ -541,7 +567,7 @@ impl YouTubeListMapper { fn map_item(&mut self, item: YouTubeListItem) { match item { YouTubeListItem::PlaylistRenderer(playlist) => { - self.items.push(Self::map_playlist(playlist)) + self.items.push(self.map_playlist(playlist)) } YouTubeListItem::ContinuationItemRenderer { continuation_endpoint, diff --git a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_livestreams.snap b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_livestreams.snap index 4fbb913..04360d1 100644 --- a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_livestreams.snap +++ b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_livestreams.snap @@ -174,7 +174,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 1 year ago"), view_count: Some(28847), @@ -209,7 +215,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 3 years ago"), view_count: Some(24182), @@ -244,7 +256,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 3 years ago"), view_count: Some(23565), @@ -279,7 +297,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 3 years ago"), view_count: Some(25015), @@ -314,7 +338,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 3 years ago"), view_count: Some(8752), @@ -349,7 +379,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 3 years ago"), view_count: Some(9189), @@ -384,7 +420,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 3 years ago"), view_count: Some(17241), @@ -419,7 +461,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 3 years ago"), view_count: Some(47171), @@ -454,7 +502,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 3 years ago"), view_count: Some(23998), @@ -489,7 +543,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 4 years ago"), view_count: Some(36880), @@ -524,7 +584,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 4 years ago"), view_count: Some(49061), @@ -559,7 +625,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 4 years ago"), view_count: Some(13210), @@ -594,7 +666,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 4 years ago"), view_count: Some(37927), @@ -629,7 +707,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 5 years ago"), view_count: Some(18865), @@ -664,7 +748,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 5 years ago"), view_count: Some(72807), @@ -699,7 +789,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 5 years ago"), view_count: Some(61173), @@ -734,7 +830,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 6 years ago"), view_count: Some(13529), @@ -769,7 +871,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 6 years ago"), view_count: Some(6536), @@ -804,7 +912,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 6 years ago"), view_count: Some(14472), @@ -839,7 +953,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 6 years ago"), view_count: Some(21240), @@ -874,7 +994,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 6 years ago"), view_count: Some(30840), @@ -909,7 +1035,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 6 years ago"), view_count: Some(34258), @@ -944,7 +1076,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 6 years ago"), view_count: Some(26864), @@ -979,7 +1117,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 6 years ago"), view_count: Some(10757), @@ -1014,7 +1158,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 7 years ago"), view_count: Some(21599), @@ -1049,7 +1199,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 7 years ago"), view_count: Some(23010), @@ -1084,7 +1240,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 7 years ago"), view_count: Some(24056), @@ -1119,7 +1281,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 7 years ago"), view_count: Some(41211), @@ -1154,7 +1322,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 8 years ago"), view_count: Some(25316), @@ -1189,7 +1363,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(884000), + )), publish_date: "[date]", publish_date_txt: Some("Streamed 8 years ago"), view_count: Some(11747), diff --git a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_playlists.snap b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_playlists.snap index ad13f0f..1ccf5b6 100644 --- a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_playlists.snap +++ b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_playlists.snap @@ -158,7 +158,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(2), ), PlaylistItem( @@ -171,7 +177,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(1), ), PlaylistItem( @@ -184,7 +196,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(9), ), PlaylistItem( @@ -197,7 +215,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(2), ), PlaylistItem( @@ -210,7 +234,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(4), ), PlaylistItem( @@ -223,7 +253,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(18), ), PlaylistItem( @@ -236,7 +272,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(3), ), PlaylistItem( @@ -249,7 +291,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(8), ), PlaylistItem( @@ -262,7 +310,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(13), ), PlaylistItem( @@ -275,7 +329,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(9), ), PlaylistItem( @@ -288,7 +348,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(7), ), PlaylistItem( @@ -301,7 +367,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(3), ), PlaylistItem( @@ -314,7 +386,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(8), ), PlaylistItem( @@ -327,7 +405,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(2), ), PlaylistItem( @@ -340,7 +424,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(3), ), PlaylistItem( @@ -353,7 +443,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(10), ), PlaylistItem( @@ -366,7 +462,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(1), ), PlaylistItem( @@ -379,7 +481,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(9), ), PlaylistItem( @@ -392,7 +500,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(16), ), PlaylistItem( @@ -405,7 +519,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(7), ), PlaylistItem( @@ -418,7 +538,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(6), ), PlaylistItem( @@ -431,7 +557,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(12), ), PlaylistItem( @@ -444,7 +576,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(1), ), PlaylistItem( @@ -457,7 +595,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(5), ), PlaylistItem( @@ -470,7 +614,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(2), ), PlaylistItem( @@ -483,7 +633,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(4), ), PlaylistItem( @@ -496,7 +652,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(1), ), PlaylistItem( @@ -509,7 +671,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(2), ), PlaylistItem( @@ -522,7 +690,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(9), ), PlaylistItem( @@ -535,7 +709,13 @@ Channel( height: 270, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(881000), + )), video_count: Some(1), ), ], diff --git a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_shorts.snap b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_shorts.snap index 0bd996c..fce6ee6 100644 --- a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_shorts.snap +++ b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_shorts.snap @@ -130,7 +130,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(593), @@ -150,7 +156,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(141), @@ -170,7 +182,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(652), @@ -190,7 +208,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(795), @@ -210,7 +234,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(17), @@ -230,7 +260,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(1), @@ -250,7 +286,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(15), @@ -270,7 +312,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(26), @@ -290,7 +338,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(864), @@ -310,7 +364,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(21), @@ -330,7 +390,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(1), @@ -350,7 +416,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(45), @@ -370,7 +442,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(18), @@ -390,7 +468,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(16), @@ -410,7 +494,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(13), @@ -430,7 +520,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(34), @@ -450,7 +546,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(13), @@ -470,7 +572,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(756), @@ -490,7 +598,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(13), @@ -510,7 +624,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(39), @@ -530,7 +650,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(18), @@ -550,7 +676,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(31), @@ -570,7 +702,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(17), @@ -590,7 +728,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(18), @@ -610,7 +754,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(18), @@ -630,7 +780,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(11), @@ -650,7 +806,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(31), @@ -670,7 +832,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(688), @@ -690,7 +858,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(19), @@ -710,7 +884,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(1), @@ -730,7 +910,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(64), @@ -750,7 +936,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(16), @@ -770,7 +962,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(27), @@ -790,7 +988,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(25), @@ -810,7 +1014,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(2), @@ -830,7 +1040,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(53), @@ -850,7 +1066,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(2), @@ -870,7 +1092,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(91), @@ -890,7 +1118,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(26), @@ -910,7 +1144,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(65), @@ -930,7 +1170,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(22), @@ -950,7 +1196,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(66), @@ -970,7 +1222,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(39), @@ -990,7 +1248,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(978), @@ -1010,7 +1274,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(45), @@ -1030,7 +1300,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(21), @@ -1050,7 +1326,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(4), @@ -1070,7 +1352,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2980000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(63), diff --git a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_20221011_richgrid.snap b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_20221011_richgrid.snap index 9352733..0bb35f9 100644 --- a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_20221011_richgrid.snap +++ b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_20221011_richgrid.snap @@ -145,7 +145,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("9 hours ago"), view_count: Some(142423), @@ -180,7 +186,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("7 days ago"), view_count: Some(989763), @@ -215,7 +227,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("2 weeks ago"), view_count: Some(355470), @@ -250,7 +268,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("3 weeks ago"), view_count: Some(697188), @@ -285,7 +309,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("4 weeks ago"), view_count: Some(529586), @@ -320,7 +350,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(1066729), @@ -355,7 +391,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(525663), @@ -390,7 +432,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(717806), @@ -425,7 +473,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(624673), @@ -460,7 +514,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("3 months ago"), view_count: Some(924135), @@ -495,7 +555,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("3 months ago"), view_count: Some(1053353), @@ -530,7 +596,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("3 months ago"), view_count: Some(697242), @@ -565,7 +637,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("4 months ago"), view_count: Some(1086097), @@ -600,7 +678,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("4 months ago"), view_count: Some(528979), @@ -635,7 +719,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("4 months ago"), view_count: Some(1036890), @@ -670,7 +760,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("4 months ago"), view_count: Some(832542), @@ -705,7 +801,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("4 months ago"), view_count: Some(1342882), @@ -740,7 +842,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("4 months ago"), view_count: Some(1076848), @@ -775,7 +883,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("5 months ago"), view_count: Some(562349), @@ -810,7 +924,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("6 months ago"), view_count: Some(531938), @@ -845,7 +965,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("6 months ago"), view_count: Some(426469), @@ -880,7 +1006,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("6 months ago"), view_count: Some(448915), @@ -915,7 +1047,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("6 months ago"), view_count: Some(675443), @@ -950,7 +1088,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("6 months ago"), view_count: Some(426465), @@ -985,7 +1129,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("7 months ago"), view_count: Some(1137831), @@ -1020,7 +1170,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("7 months ago"), view_count: Some(612275), @@ -1055,7 +1211,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("7 months ago"), view_count: Some(396397), @@ -1090,7 +1252,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("7 months ago"), view_count: Some(599030), @@ -1125,7 +1293,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("7 months ago"), view_count: Some(530192), @@ -1160,7 +1334,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2930000), + )), publish_date: "[date]", publish_date_txt: Some("8 months ago"), view_count: Some(567604), diff --git a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_20221011_richgrid2.snap b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_20221011_richgrid2.snap index 0a8dc05..551d8e1 100644 --- a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_20221011_richgrid2.snap +++ b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_20221011_richgrid2.snap @@ -174,7 +174,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("1 day ago"), view_count: Some(8813), @@ -209,7 +215,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("6 days ago"), view_count: Some(48599), @@ -244,7 +256,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("10 days ago"), view_count: Some(74126), @@ -279,7 +297,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("11 days ago"), view_count: Some(36129), @@ -314,7 +338,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("2 weeks ago"), view_count: Some(87357), @@ -349,7 +379,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("2 weeks ago"), view_count: Some(48259), @@ -384,7 +420,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("3 weeks ago"), view_count: Some(27509), @@ -419,7 +461,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("3 weeks ago"), view_count: Some(57925), @@ -454,7 +502,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(77907), @@ -489,7 +543,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(63421), @@ -524,7 +584,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(73052), @@ -559,7 +625,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(93529), @@ -594,7 +666,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(41569), @@ -629,7 +707,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(22842), @@ -664,7 +748,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(41621), @@ -699,7 +789,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(77542), @@ -734,7 +830,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(34947), @@ -769,7 +871,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(45618), @@ -804,7 +912,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(34868), @@ -839,7 +953,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(64336), @@ -874,7 +994,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(150958), @@ -909,7 +1035,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(30903), @@ -944,7 +1076,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(48669), @@ -979,7 +1117,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(83505), @@ -1014,7 +1158,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(42843), @@ -1049,7 +1199,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("3 months ago"), view_count: Some(26036), @@ -1084,7 +1240,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("3 months ago"), view_count: Some(63729), @@ -1119,7 +1281,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("3 months ago"), view_count: Some(22920), @@ -1154,7 +1322,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("3 months ago"), view_count: Some(66042), @@ -1189,7 +1363,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(883000), + )), publish_date: "[date]", publish_date_txt: Some("3 months ago"), view_count: Some(52065), diff --git a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_base.snap b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_base.snap index 4af47ed..e13381c 100644 --- a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_base.snap +++ b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_base.snap @@ -174,7 +174,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("20 hours ago"), view_count: Some(19739), @@ -209,7 +215,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("5 days ago"), view_count: Some(24194), @@ -244,7 +256,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("7 days ago"), view_count: Some(51443), @@ -279,7 +297,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("13 days ago"), view_count: Some(72324), @@ -314,7 +338,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("2 weeks ago"), view_count: Some(57348), @@ -349,7 +379,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("2 weeks ago"), view_count: Some(68645), @@ -384,7 +420,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("3 weeks ago"), view_count: Some(91388), @@ -419,7 +461,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("3 weeks ago"), view_count: Some(39993), @@ -454,7 +502,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("4 weeks ago"), view_count: Some(22512), @@ -489,7 +543,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(40137), @@ -524,7 +584,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(74510), @@ -559,7 +625,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(34487), @@ -594,7 +666,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(44928), @@ -629,7 +707,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(34324), @@ -664,7 +748,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(63763), @@ -699,7 +789,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(149186), @@ -734,7 +830,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(30130), @@ -769,7 +871,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(48037), @@ -804,7 +912,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(81958), @@ -839,7 +953,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(42635), @@ -874,7 +994,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(25860), @@ -909,7 +1035,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(63035), @@ -944,7 +1076,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(22731), @@ -979,7 +1117,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(65765), @@ -1014,7 +1158,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(51555), @@ -1049,7 +1199,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(46638), @@ -1084,7 +1240,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("3 months ago"), view_count: Some(62921), @@ -1119,7 +1281,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("3 months ago"), view_count: Some(66895), @@ -1154,7 +1322,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("3 months ago"), view_count: Some(25894), @@ -1189,7 +1363,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UC2DjFE7Xf11URZqWBigcVOQ", + name: "EEVblog", + avatar: [], + verification: Verified, + subscriber_count: Some(880000), + )), publish_date: "[date]", publish_date_txt: Some("3 months ago"), view_count: Some(80173), diff --git a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_live.snap b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_live.snap index 6456184..945fe0b 100644 --- a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_live.snap +++ b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_live.snap @@ -158,7 +158,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(94), @@ -193,7 +199,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(381), @@ -228,7 +240,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("1 year ago"), view_count: Some(241528), @@ -263,7 +281,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("1 year ago"), view_count: Some(118351), @@ -298,7 +322,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("1 year ago"), view_count: Some(157971), @@ -333,7 +363,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("1 year ago"), view_count: Some(82309), @@ -368,7 +404,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(2043), @@ -403,7 +445,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("2 years ago"), view_count: Some(186475), @@ -438,7 +486,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("2 years ago"), view_count: Some(66425), @@ -473,7 +527,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("2 years ago"), view_count: Some(1520020), @@ -508,7 +568,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("2 years ago"), view_count: Some(37549), @@ -543,7 +609,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("2 years ago"), view_count: Some(33002), @@ -578,7 +650,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("2 years ago"), view_count: Some(42036), @@ -613,7 +691,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("2 years ago"), view_count: Some(322935), @@ -648,7 +732,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("2 years ago"), view_count: Some(91980), @@ -683,7 +773,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: None, view_count: Some(4030), @@ -718,7 +814,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("2 years ago"), view_count: Some(288098), @@ -753,7 +855,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("2 years ago"), view_count: Some(50818), @@ -788,7 +896,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("2 years ago"), view_count: Some(98431), @@ -823,7 +937,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("3 years ago"), view_count: Some(572456), @@ -858,7 +978,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UChs0pSaEoNLV4mevBFGaoKA", + name: "The Good Life Radio x Sensual Musique", + avatar: [], + verification: Verified, + subscriber_count: Some(760000), + )), publish_date: "[date]", publish_date_txt: Some("3 years ago"), view_count: Some(3114909), diff --git a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_shorts.snap b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_shorts.snap index cdd68c0..c2a8a42 100644 --- a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_shorts.snap +++ b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_shorts.snap @@ -130,7 +130,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("1 day ago"), view_count: Some(443549), @@ -150,7 +156,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("2 days ago"), view_count: Some(1154962), @@ -185,7 +197,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("3 days ago"), view_count: Some(477460), @@ -205,7 +223,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("6 days ago"), view_count: Some(1388173), @@ -225,7 +249,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("7 days ago"), view_count: Some(1738301), @@ -245,7 +275,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("9 days ago"), view_count: Some(1316594), @@ -280,7 +316,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("10 days ago"), view_count: Some(478703), @@ -300,7 +342,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("11 days ago"), view_count: Some(1412213), @@ -320,7 +368,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("13 days ago"), view_count: Some(1513305), @@ -340,7 +394,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("2 weeks ago"), view_count: Some(8936223), @@ -375,7 +435,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("2 weeks ago"), view_count: Some(987083), @@ -395,7 +461,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("2 weeks ago"), view_count: Some(2769717), @@ -430,7 +502,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("3 weeks ago"), view_count: Some(497660), @@ -450,7 +528,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("3 weeks ago"), view_count: Some(572107), @@ -470,7 +554,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("3 weeks ago"), view_count: Some(1707132), @@ -490,7 +580,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("3 weeks ago"), view_count: Some(933094), @@ -510,7 +606,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(5985184), @@ -530,7 +632,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(14741387), @@ -550,7 +658,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(2511322), @@ -570,7 +684,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(2364408), @@ -605,7 +725,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(706059), @@ -625,7 +751,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(1947627), @@ -645,7 +777,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(4763839), @@ -665,7 +803,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(1915695), @@ -685,7 +829,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(7268944), @@ -705,7 +855,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(2539103), @@ -725,7 +881,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(5545680), @@ -745,7 +907,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(2202314), @@ -780,7 +948,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(613416), @@ -800,7 +974,13 @@ Channel( height: 720, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCh8gHdtzO2tXd593_bjErWg", + name: "Doobydobap", + avatar: [], + verification: Verified, + subscriber_count: Some(2840000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(6443699), diff --git a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_upcoming.snap b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_upcoming.snap index ea3c4b8..b4a20a4 100644 --- a/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_upcoming.snap +++ b/src/client/snapshots/rustypipe__client__channel__tests__map_channel_videos_upcoming.snap @@ -162,7 +162,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: Some("2022-09-27T16:00:00Z"), publish_date_txt: None, view_count: Some(237), @@ -197,7 +203,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("13 days ago"), view_count: Some(742284), @@ -232,7 +244,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("3 weeks ago"), view_count: Some(420368), @@ -267,7 +285,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("3 weeks ago"), view_count: Some(528718), @@ -302,7 +326,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(897237), @@ -337,7 +367,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(526638), @@ -372,7 +408,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(368801), @@ -407,7 +449,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(286737), @@ -442,7 +490,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("1 month ago"), view_count: Some(664499), @@ -477,7 +531,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(592227), @@ -512,7 +572,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(396946), @@ -547,7 +613,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("2 months ago"), view_count: Some(778430), @@ -582,7 +654,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("3 months ago"), view_count: Some(2118499), @@ -617,7 +695,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("3 months ago"), view_count: Some(525824), @@ -652,7 +736,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("3 months ago"), view_count: Some(1097056), @@ -687,7 +777,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("4 months ago"), view_count: Some(1532114), @@ -722,7 +818,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("4 months ago"), view_count: Some(511601), @@ -757,7 +859,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("4 months ago"), view_count: Some(662099), @@ -792,7 +900,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("4 months ago"), view_count: Some(549826), @@ -827,7 +941,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("4 months ago"), view_count: Some(538197), @@ -862,7 +982,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("5 months ago"), view_count: Some(536648), @@ -897,7 +1023,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("5 months ago"), view_count: Some(724630), @@ -932,7 +1064,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("5 months ago"), view_count: Some(426960), @@ -967,7 +1105,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("6 months ago"), view_count: Some(735941), @@ -1002,7 +1146,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("6 months ago"), view_count: Some(502205), @@ -1037,7 +1187,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("6 months ago"), view_count: Some(718668), @@ -1072,7 +1228,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("7 months ago"), view_count: Some(775830), @@ -1107,7 +1269,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("7 months ago"), view_count: Some(480357), @@ -1142,7 +1310,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("7 months ago"), view_count: Some(460878), @@ -1177,7 +1351,13 @@ Channel( height: 188, ), ], - channel: None, + channel: Some(ChannelTag( + id: "UCcvfHa-GHSOHFAjU0-Ie57A", + name: "Adam Something", + avatar: [], + verification: Verified, + subscriber_count: Some(947000), + )), publish_date: "[date]", publish_date_txt: Some("7 months ago"), view_count: Some(228151), diff --git a/src/model/convert.rs b/src/model/convert.rs new file mode 100644 index 0000000..5715434 --- /dev/null +++ b/src/model/convert.rs @@ -0,0 +1,64 @@ +use super::{Channel, ChannelId, ChannelItem, ChannelTag, PlaylistItem, VideoItem, YouTubeItem}; + +impl TryFrom for VideoItem { + type Error = (); + + fn try_from(value: YouTubeItem) -> Result { + match value { + YouTubeItem::Video(video) => Ok(video), + _ => Err(()), + } + } +} + +impl TryFrom for PlaylistItem { + type Error = (); + + fn try_from(value: YouTubeItem) -> Result { + match value { + YouTubeItem::Playlist(playlist) => Ok(playlist), + _ => Err(()), + } + } +} + +impl TryFrom for ChannelItem { + type Error = (); + + fn try_from(value: YouTubeItem) -> Result { + match value { + YouTubeItem::Channel(channel) => Ok(channel), + _ => Err(()), + } + } +} + +impl From> for ChannelTag { + fn from(channel: Channel) -> Self { + Self { + id: channel.id, + name: channel.name, + avatar: channel.avatar, + verification: channel.verification, + subscriber_count: channel.subscriber_count, + } + } +} + +impl From for ChannelId { + fn from(channel: ChannelTag) -> Self { + Self { + id: channel.id, + name: channel.name, + } + } +} + +impl From> for ChannelId { + fn from(channel: Channel) -> Self { + Self { + id: channel.id, + name: channel.name, + } + } +} diff --git a/src/model/mod.rs b/src/model/mod.rs index 1418b1f..c738cd1 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -1,5 +1,6 @@ //! YouTube API request and response models +mod convert; mod ordering; mod paginator; pub mod richtext; @@ -850,36 +851,3 @@ pub struct PlaylistItem { /// Number of playlist videos pub video_count: Option, } - -impl TryFrom for VideoItem { - type Error = (); - - fn try_from(value: YouTubeItem) -> Result { - match value { - YouTubeItem::Video(video) => Ok(video), - _ => Err(()), - } - } -} - -impl TryFrom for PlaylistItem { - type Error = (); - - fn try_from(value: YouTubeItem) -> Result { - match value { - YouTubeItem::Playlist(playlist) => Ok(playlist), - _ => Err(()), - } - } -} - -impl TryFrom for ChannelItem { - type Error = (); - - fn try_from(value: YouTubeItem) -> Result { - match value { - YouTubeItem::Channel(channel) => Ok(channel), - _ => Err(()), - } - } -} From 082d1c6c92462b170f6260274961af995d293a8f Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Sat, 29 Oct 2022 00:50:12 +0200 Subject: [PATCH 2/3] refactor: remove askama_html dependency --- Cargo.toml | 6 ++---- src/model/richtext.rs | 17 +++++------------ src/util/mod.rs | 18 ++++++++++++++++++ tests/youtube.rs | 3 ++- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bcfdfbc..a8a7d68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,11 +13,10 @@ include = ["/src", "README.md", "LICENSE", "!snapshots"] members = [".", "codegen", "cli"] [features] -default = ["default-tls", "rss"] -all = ["rss", "html"] +default = ["default-tls"] +all = ["rss"] rss = ["quick-xml"] -html = ["askama_escape"] # Reqwest TLS default-tls = ["reqwest/default-tls"] @@ -45,7 +44,6 @@ filenamify = "0.1.0" ress = "0.11.4" phf = "0.11.1" base64 = "0.13.0" -askama_escape = {version = "0.10.3", optional = true} quick-xml = {version = "0.25.0", features = ["serialize"], optional = true} [dev-dependencies] diff --git a/src/model/richtext.rs b/src/model/richtext.rs index f8ef5f2..c4609be 100644 --- a/src/model/richtext.rs +++ b/src/model/richtext.rs @@ -2,6 +2,8 @@ use serde::{Deserialize, Serialize}; +use crate::util; + use super::UrlTarget; #[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] @@ -32,8 +34,6 @@ pub trait ToPlaintext { } /// Trait for converting rich text to html. -#[cfg(feature = "html")] -#[cfg_attr(docsrs, doc(cfg(feature = "html")))] pub trait ToHtml { /// Convert rich text to html. fn to_html(&self) -> String { @@ -72,26 +72,22 @@ impl ToPlaintext for TextComponent { } } -#[cfg(feature = "html")] -#[cfg_attr(docsrs, doc(cfg(feature = "html")))] impl ToHtml for TextComponent { fn to_html_yt_host(&self, yt_host: &str) -> String { match self { - TextComponent::Text(text) => askama_escape::escape(&text, askama_escape::Html) - .to_string() - .replace("\n", "
"), + TextComponent::Text(text) => util::escape_html(text), TextComponent::Web { text, .. } => { format!( r#"{}"#, self.get_url(yt_host), - askama_escape::escape(text, askama_escape::Html) + util::escape_html(text) ) } _ => { format!( r#"{}"#, self.get_url(yt_host), - askama_escape::escape(self.get_text(), askama_escape::Html) + util::escape_html(self.get_text()) ) } } @@ -107,8 +103,6 @@ impl ToPlaintext for RichText { } } -#[cfg(feature = "html")] -#[cfg_attr(docsrs, doc(cfg(feature = "html")))] impl ToHtml for RichText { fn to_html_yt_host(&self, yt_host: &str) -> String { self.0.iter().map(|c| c.to_html_yt_host(yt_host)).collect() @@ -186,7 +180,6 @@ aespa 에스파 'Black Mamba' MV ℗ SM Entertainment"# ); } - #[cfg(feature = "html")] #[test] fn t_to_html() { let richtext = RichText::from(TEXT_SOURCE.clone()); diff --git a/src/util/mod.rs b/src/util/mod.rs index 02a746f..e59f19c 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -312,6 +312,24 @@ where .ok() } +/// Replace all html control characters to make a string safe for inserting into HTML. +pub fn escape_html(input: &str) -> String { + let mut buf = String::with_capacity(input.len()); + + for c in input.chars() { + match c { + '<' => buf.push_str("<"), + '>' => buf.push_str(">"), + '&' => buf.push_str("&"), + '"' => buf.push_str("""), + '\'' => buf.push_str("'"), + '\n' => buf.push_str("
"), + _ => buf.push(c), + }; + } + buf +} + #[cfg(test)] mod tests { use std::{fs::File, io::BufReader, path::Path}; diff --git a/tests/youtube.rs b/tests/youtube.rs index 51064ec..8bfee49 100644 --- a/tests/youtube.rs +++ b/tests/youtube.rs @@ -1,7 +1,7 @@ use std::collections::HashSet; use rstest::rstest; -use time::macros::{date, datetime}; +use time::macros::date; use time::OffsetDateTime; use rustypipe::client::{ClientType, RustyPipe}; @@ -1138,6 +1138,7 @@ async fn channel_not_found(#[case] id: &str) { #[cfg(feature = "rss")] mod channel_rss { use super::*; + use time::macros::datetime; #[tokio::test] async fn get_channel_rss() { From b64aabb6b62da942740db585edce89e0615bb977 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Sat, 29 Oct 2022 07:43:10 +0200 Subject: [PATCH 3/3] refactor: simplify channel mapping --- src/client/channel.rs | 157 ++++++++++++++++-------------------------- 1 file changed, 61 insertions(+), 96 deletions(-) diff --git a/src/client/channel.rs b/src/client/channel.rs index 715e4f1..036b6ea 100644 --- a/src/client/channel.rs +++ b/src/client/channel.rs @@ -136,10 +136,6 @@ impl MapResponse>> for response::Channel { _deobf: Option<&crate::deobfuscate::Deobfuscator>, ) -> Result>>, ExtractionError> { let content = map_channel_content(self.contents, self.alerts)?; - let grid = match content.content { - response::channel::ChannelContent::GridRenderer { items } => Some(items), - _ => None, - }; let channel_data = map_channel( MapChannelData { @@ -154,37 +150,22 @@ impl MapResponse>> for response::Channel { lang, )?; - let v_res = grid - .map(|g| { + let v_res = match content.content { + ChannelContent::GridRenderer { items } => { let mut mapper = response::YouTubeListMapper::::with_channel(lang, &channel_data); - mapper.map_response(g); + mapper.map_response(items); MapResult { c: Paginator::new(None, mapper.items, mapper.ctoken), warnings: mapper.warnings, } - }) - .unwrap_or_default(); + } + _ => MapResult::default(), + }; Ok(MapResult { - c: Channel { - id: channel_data.id, - name: channel_data.name, - subscriber_count: channel_data.subscriber_count, - avatar: channel_data.avatar, - verification: channel_data.verification, - description: channel_data.description, - tags: channel_data.tags, - vanity_url: channel_data.vanity_url, - banner: channel_data.banner, - mobile_banner: channel_data.mobile_banner, - tv_banner: channel_data.tv_banner, - has_shorts: channel_data.has_shorts, - has_live: channel_data.has_live, - visitor_data: channel_data.visitor_data, - content: v_res.c, - }, + c: combine_channel_data(channel_data, v_res.c), warnings: v_res.warnings, }) } @@ -198,10 +179,6 @@ impl MapResponse>> for response::Channel { _deobf: Option<&crate::deobfuscate::Deobfuscator>, ) -> Result>>, ExtractionError> { let content = map_channel_content(self.contents, self.alerts)?; - let grid = match content.content { - response::channel::ChannelContent::GridRenderer { items } => Some(items), - _ => None, - }; let channel_data = map_channel( MapChannelData { @@ -216,37 +193,22 @@ impl MapResponse>> for response::Channel { lang, )?; - let p_res = grid - .map(|g| { + let p_res = match content.content { + ChannelContent::GridRenderer { items } => { let mut mapper = response::YouTubeListMapper::::with_channel(lang, &channel_data); - mapper.map_response(g); + mapper.map_response(items); MapResult { c: Paginator::new(None, mapper.items, mapper.ctoken), warnings: mapper.warnings, } - }) - .unwrap_or_default(); + } + _ => MapResult::default(), + }; Ok(MapResult { - c: Channel { - id: channel_data.id, - name: channel_data.name, - subscriber_count: channel_data.subscriber_count, - avatar: channel_data.avatar, - verification: channel_data.verification, - description: channel_data.description, - tags: channel_data.tags, - vanity_url: channel_data.vanity_url, - banner: channel_data.banner, - mobile_banner: channel_data.mobile_banner, - tv_banner: channel_data.tv_banner, - has_shorts: channel_data.has_shorts, - has_live: channel_data.has_live, - visitor_data: channel_data.visitor_data, - content: p_res.c, - }, + c: combine_channel_data(channel_data, p_res.c), warnings: p_res.warnings, }) } @@ -261,10 +223,6 @@ impl MapResponse> for response::Channel { ) -> Result>, ExtractionError> { let content = map_channel_content(self.contents, self.alerts)?; let mut warnings = Vec::new(); - let meta = match content.content { - response::channel::ChannelContent::ChannelAboutFullMetadataRenderer(meta) => Some(meta), - _ => None, - }; let channel_data = map_channel( MapChannelData { @@ -279,54 +237,41 @@ impl MapResponse> for response::Channel { lang, )?; - let cinfo = meta - .map(|meta| ChannelInfo { - create_date: timeago::parse_textual_date_or_warn( - lang, - &meta.joined_date_text, - &mut warnings, - ) - .map(OffsetDateTime::date), - view_count: meta - .view_count_text - .and_then(|txt| util::parse_numeric_or_warn(&txt, &mut warnings)), - links: meta - .primary_links - .into_iter() - .filter_map(|l| { - l.navigation_endpoint - .url_endpoint - .map(|url| (l.title, util::sanitize_yt_url(&url.url))) - }) - .collect(), - }) - .unwrap_or_else(|| { + let cinfo = match content.content { + response::channel::ChannelContent::ChannelAboutFullMetadataRenderer(meta) => { + ChannelInfo { + create_date: timeago::parse_textual_date_or_warn( + lang, + &meta.joined_date_text, + &mut warnings, + ) + .map(OffsetDateTime::date), + view_count: meta + .view_count_text + .and_then(|txt| util::parse_numeric_or_warn(&txt, &mut warnings)), + links: meta + .primary_links + .into_iter() + .filter_map(|l| { + l.navigation_endpoint + .url_endpoint + .map(|url| (l.title, util::sanitize_yt_url(&url.url))) + }) + .collect(), + } + } + _ => { warnings.push("no aboutFullMetadata".to_owned()); ChannelInfo { create_date: None, view_count: None, links: Vec::new(), } - }); + } + }; Ok(MapResult { - c: Channel { - id: channel_data.id, - name: channel_data.name, - subscriber_count: channel_data.subscriber_count, - avatar: channel_data.avatar, - verification: channel_data.verification, - description: channel_data.description, - tags: channel_data.tags, - vanity_url: channel_data.vanity_url, - banner: channel_data.banner, - mobile_banner: channel_data.mobile_banner, - tv_banner: channel_data.tv_banner, - has_shorts: channel_data.has_shorts, - has_live: channel_data.has_live, - visitor_data: channel_data.visitor_data, - content: cinfo, - }, + c: combine_channel_data(channel_data, cinfo), warnings, }) } @@ -536,6 +481,26 @@ fn map_channel_content( } } +fn combine_channel_data(channel_data: Channel<()>, content: T) -> Channel { + Channel { + id: channel_data.id, + name: channel_data.name, + subscriber_count: channel_data.subscriber_count, + avatar: channel_data.avatar, + verification: channel_data.verification, + description: channel_data.description, + tags: channel_data.tags, + vanity_url: channel_data.vanity_url, + banner: channel_data.banner, + mobile_banner: channel_data.mobile_banner, + tv_banner: channel_data.tv_banner, + has_shorts: channel_data.has_shorts, + has_live: channel_data.has_live, + visitor_data: channel_data.visitor_data, + content, + } +} + #[cfg(test)] mod tests { use std::{fs::File, io::BufReader, path::Path};