WIP: new artistid model

This commit is contained in:
ThetaDev 2022-11-02 16:58:07 +01:00
parent 45e2d3c7c7
commit a7db75ff07

View file

@ -875,15 +875,7 @@ pub struct TrackItem {
/// Album cover /// Album cover
pub cover: Vec<Thumbnail>, pub cover: Vec<Thumbnail>,
/// Artists of the track /// Artists of the track
/// pub artists: Vec<ArtistId>,
/// **Note:** this field only contains artists that have a link attached
/// to them. You may want to use `artists_txt` as a fallback.
pub artists: Vec<ChannelId>,
/// Full content of the artists column
///
/// Conjunction words/characters depend on language and fetched page.
/// Includes unlinked artists.
pub artists_txt: Option<String>,
/// Album of the track /// Album of the track
pub album: Option<AlbumId>, pub album: Option<AlbumId>,
/// View count /// View count
@ -914,6 +906,14 @@ pub struct ArtistItem {
pub subscriber_count: Option<u64>, pub subscriber_count: Option<u64>,
} }
/// YouTube Music artist identifier
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[non_exhaustive]
pub struct ArtistId {
pub id: Option<String>,
pub name: String,
}
/// YouTube Music album list item /// YouTube Music album list item
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[non_exhaustive] #[non_exhaustive]
@ -925,12 +925,7 @@ pub struct AlbumItem {
/// Album cover /// Album cover
pub cover: Vec<Thumbnail>, pub cover: Vec<Thumbnail>,
/// Artists of the album /// Artists of the album
pub artists: Vec<ChannelId>, pub artists: Vec<ArtistId>,
/// Full content of the artists field
///
/// Conjunction words/characters depend on language and fetched page.
/// Includes unlinked artists.
pub artists_txt: String,
/// Album type (Album/Single/EP) /// Album type (Album/Single/EP)
pub album_type: AlbumType, pub album_type: AlbumType,
/// Release year of the album /// Release year of the album
@ -1019,12 +1014,7 @@ pub struct MusicAlbum {
/// Album cover /// Album cover
pub cover: Vec<Thumbnail>, pub cover: Vec<Thumbnail>,
/// Artists of the album /// Artists of the album
pub artists: Vec<ChannelId>, pub artists: Vec<ArtistId>,
/// Full content of the artists field
///
/// Conjunction words/characters depend on language and fetched page.
/// Includes unlinked artists.
pub artists_txt: String,
/// Album type (Album/Single/EP) /// Album type (Album/Single/EP)
pub album_type: AlbumType, pub album_type: AlbumType,
/// Release year /// Release year