feat!: add TV client

This commit is contained in:
ThetaDev 2024-07-30 01:55:24 +02:00
parent b6bc05c1f3
commit e608811e5f
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6
18 changed files with 3887 additions and 132 deletions

View file

@ -156,7 +156,7 @@ pub struct VideoPlayerDetails {
/// Unique YouTube video ID
pub id: String,
/// Video title
pub name: String,
pub name: Option<String>,
/// Video description in plaintext format
pub description: Option<String>,
/// Video duration in seconds
@ -165,10 +165,12 @@ pub struct VideoPlayerDetails {
pub duration: u32,
/// Video thumbnail
pub thumbnail: Vec<Thumbnail>,
/// Channel of the video
pub channel: ChannelId,
/// Channel ID of the video
pub channel_id: String,
/// Channel name of the video
pub channel_name: Option<String>,
/// Number of views / current viewers in case of a livestream.
pub view_count: u64,
pub view_count: Option<u64>,
/// List of words that describe the topic of the video
pub keywords: Vec<String>,
/// True if the video is an active livestream

View file

@ -233,6 +233,7 @@ macro_rules! yt_entity_owner_music {
};
}
/*
impl YtEntity for VideoPlayer {
fn id(&self) -> &str {
&self.details.id
@ -243,14 +244,33 @@ impl YtEntity for VideoPlayer {
}
fn channel_id(&self) -> Option<&str> {
Some(&self.details.channel.id)
Some(&self.details.channel_id)
}
fn channel_name(&self) -> Option<&str> {
Some(&self.details.channel.name)
self.details.channel_name.as_deref()
}
}
impl YtEntity for VideoPlayerDetails {
fn id(&self) -> &str {
&self.channel_id
}
fn name(&self) -> &str {
&self.name
}
fn channel_id(&self) -> Option<&str> {
Some(&self.channel_id)
}
fn channel_name(&self) -> Option<&str> {
self.channel_name.as_deref()
}
}
*/
impl<T> YtEntity for Channel<T> {
fn id(&self) -> &str {
&self.id
@ -269,7 +289,6 @@ impl<T> YtEntity for Channel<T> {
}
}
yt_entity_owner! {VideoPlayerDetails}
yt_entity_owner_opt! {Playlist}
yt_entity! {ChannelId}
yt_entity_owner! {VideoDetails}