feat: add lyrics
This commit is contained in:
parent
dae8c1e775
commit
2cd74b1da8
12 changed files with 262 additions and 10 deletions
|
|
@ -16,6 +16,7 @@ pub(crate) use channel::Channel;
|
|||
pub(crate) use music_artist::MusicArtist;
|
||||
pub(crate) use music_artist::MusicArtistAlbums;
|
||||
pub(crate) use music_details::MusicDetails;
|
||||
pub(crate) use music_details::MusicLyrics;
|
||||
pub(crate) use music_item::MusicContinuation;
|
||||
pub(crate) use music_playlist::MusicPlaylist;
|
||||
pub(crate) use music_search::MusicSearch;
|
||||
|
|
@ -62,6 +63,12 @@ pub(crate) struct Tab<T> {
|
|||
pub tab_renderer: ContentRenderer<T>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub(crate) struct SectionList<T> {
|
||||
pub section_list_renderer: ContentsRenderer<T>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub(crate) struct ThumbnailsWrap {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue