feat: add lyrics

This commit is contained in:
ThetaDev 2022-11-11 00:14:58 +01:00
parent dae8c1e775
commit 2cd74b1da8
12 changed files with 262 additions and 10 deletions

View file

@ -1,6 +1,9 @@
use serde::Deserialize;
use serde_with::serde_as;
use super::{music_item::PlaylistPanelRenderer, ContentRenderer};
use crate::serializer::text::Text;
use super::{music_item::PlaylistPanelRenderer, ContentRenderer, SectionList};
/// Response model for YouTube Music track details
#[derive(Debug, Deserialize)]
@ -91,3 +94,25 @@ pub(crate) struct TabContent {
pub(crate) struct PlaylistPanel {
pub playlist_panel_renderer: PlaylistPanelRenderer,
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct MusicLyrics {
pub contents: SectionList<LyricsContents>,
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct LyricsContents {
pub music_description_shelf_renderer: Option<LyricsRenderer>,
}
#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct LyricsRenderer {
#[serde_as(as = "Text")]
pub description: String,
#[serde_as(as = "Text")]
pub footer: String,
}