Lots of fixes for artist detail page and track management
This commit is contained in:
@@ -9,6 +9,46 @@ pub struct Artist {
|
||||
pub musicbrainz_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize)]
|
||||
pub struct ArtistListItem {
|
||||
pub id: i32,
|
||||
pub name: String,
|
||||
pub musicbrainz_id: Option<String>,
|
||||
pub total_watched: usize,
|
||||
pub total_owned: usize,
|
||||
pub total_items: usize,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize)]
|
||||
pub struct FullAlbumInfo {
|
||||
pub mbid: String,
|
||||
pub title: String,
|
||||
pub release_type: Option<String>,
|
||||
pub date: Option<String>,
|
||||
pub track_count: u32,
|
||||
pub local_album_id: Option<i32>,
|
||||
pub watched_tracks: u32,
|
||||
pub downloaded_tracks: u32,
|
||||
pub owned_tracks: u32,
|
||||
pub total_local_tracks: u32,
|
||||
pub status: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize)]
|
||||
pub struct FullArtistDetail {
|
||||
pub artist: Artist,
|
||||
pub albums: Vec<FullAlbumInfo>,
|
||||
pub artist_status: String,
|
||||
#[serde(default)]
|
||||
pub total_available_tracks: u32,
|
||||
#[serde(default)]
|
||||
pub total_watched_tracks: u32,
|
||||
#[serde(default)]
|
||||
pub total_owned_tracks: u32,
|
||||
#[serde(default)]
|
||||
pub enriched: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
||||
pub struct Album {
|
||||
pub id: i32,
|
||||
@@ -44,6 +84,23 @@ pub struct AlbumDetail {
|
||||
pub tracks: Vec<Track>,
|
||||
}
|
||||
|
||||
/// Album detail from MusicBrainz (the primary album view).
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize)]
|
||||
pub struct MbAlbumDetail {
|
||||
pub mbid: String,
|
||||
pub tracks: Vec<MbAlbumTrack>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize)]
|
||||
pub struct MbAlbumTrack {
|
||||
pub recording_mbid: String,
|
||||
pub title: String,
|
||||
pub track_number: Option<i32>,
|
||||
pub disc_number: Option<i32>,
|
||||
pub duration_ms: Option<u64>,
|
||||
pub status: Option<String>,
|
||||
}
|
||||
|
||||
// --- Search results ---
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user