feat: add channel info to channel response items
This commit is contained in:
parent
8026b08e2d
commit
6e77a2198d
13 changed files with 2188 additions and 412 deletions
|
|
@ -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<u64>,
|
||||
}
|
||||
|
||||
impl TryFrom<YouTubeItem> for VideoItem {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(value: YouTubeItem) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
YouTubeItem::Video(video) => Ok(video),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<YouTubeItem> for PlaylistItem {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(value: YouTubeItem) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
YouTubeItem::Playlist(playlist) => Ok(playlist),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<YouTubeItem> for ChannelItem {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(value: YouTubeItem) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
YouTubeItem::Channel(channel) => Ok(channel),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue