fix: add support for A/B-13 (2-column layout for music playlists/albums)

This commit is contained in:
ThetaDev 2024-02-29 02:54:40 +01:00
parent 2fb210b363
commit c402f463b4
14 changed files with 63535 additions and 89 deletions

View file

@ -28,6 +28,10 @@ pub(crate) enum NavigationEndpoint {
},
#[serde(rename_all = "camelCase")]
Url { url_endpoint: UrlEndpoint },
#[serde(rename_all = "camelCase")]
WatchPlaylist {
watch_playlist_endpoint: WatchPlaylistEndpoint,
},
}
#[derive(Debug, Deserialize)]
@ -54,6 +58,12 @@ pub(crate) struct BrowseEndpointWrap {
pub browse_endpoint: BrowseEndpoint,
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct WatchPlaylistEndpoint {
pub playlist_id: String,
}
impl<'de> Deserialize<'de> for BrowseEndpoint {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
@ -294,6 +304,12 @@ impl NavigationEndpoint {
)
}),
NavigationEndpoint::Url { .. } => None,
NavigationEndpoint::WatchPlaylist {
watch_playlist_endpoint,
} => Some(MusicPage {
id: watch_playlist_endpoint.playlist_id,
typ: MusicPageType::Playlist,
}),
}
}