use serde::{Deserialize, Serialize}; use uuid; /// The [MusicBrainz Identifier](https://musicbrainz.org/doc/MusicBrainz_Identifier). type Mbid = uuid::Uuid; /// An artist. May be linked to MusicBrainz. #[derive(Deserialize, Serialize)] pub struct Artist { pub name: String, pub mbid: Option, } /// A single track on a release. #[derive(Deserialize, Serialize)] pub struct Track { pub number: u32, pub title: String, pub artist: Artist, } /// MusicHoard release corresponds to MusicBrainz' concept of a release. However, it does not link /// to MusicBrainz as the intention of MusicHoard is to manage releases locally. #[derive(Deserialize, Serialize)] pub struct Release { pub title: String, pub artist: String, pub tracks: Vec, } /// MusicHoard uses MusicBrainz [primary release group /// type](https://musicbrainz.org/doc/Release_Group/Type) #[derive(Deserialize, Serialize)] pub enum ReleaseGroupType { Album, Ep, Single, Other, } /// MusicHoard uses MusicBrainz' [Release Group concept](https://musicbrainz.org/doc/Release_Group). #[derive(Deserialize, Serialize)] pub struct ReleaseGroup { pub r#type: ReleaseGroupType, pub title: String, pub artist: Artist, pub year: u32, pub mbid: Option, pub releases: Vec, }