diff options
Diffstat (limited to 'common/src/lib.rs')
| -rw-r--r-- | common/src/lib.rs | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/common/src/lib.rs b/common/src/lib.rs index d09153e..f3d8416 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -70,14 +70,11 @@ pub struct Node { pub ratings: BTreeMap<RatingType, f64>, pub pictures: BTreeMap<PictureSlot, Asset>, pub credits: BTreeMap<CreditCategory, Vec<Appearance>>, - pub identifiers: Identifiers, + pub identifiers: BTreeMap<IdentifierType, String>, pub visibility: Visibility, pub storage_size: u64, } -#[derive(Debug, Clone, Deserialize, Serialize, Default)] -pub struct Identifiers(pub BTreeMap<IdentifierType, String>); - #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, PartialOrd, Ord)] #[serde(rename_all = "snake_case")] pub enum PictureSlot { @@ -87,14 +84,20 @@ pub enum PictureSlot { Headshot, } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq, PartialOrd, Ord)] #[serde(rename_all = "snake_case")] pub enum IdentifierType { MusicbrainzRecording, MusicbrainzArtist, MusicbrainzRelease, MusicbrainzReleaseGroup, + AcoustIdTrack, + YoutubeVideo, + YoutubeChannel, + YoutubeChannelHandle, + Bandcamp, Isrc, + Barcode, Trakt, Imdb, Tmdb, @@ -103,7 +106,7 @@ pub enum IdentifierType { } #[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)] -pub struct Asset(pub String); +pub struct Asset(pub PathBuf); #[derive(Debug, Clone, Deserialize, Serialize)] pub struct Appearance { @@ -165,7 +168,7 @@ pub enum NodeKind { #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "snake_case")] pub enum TrackSource { - Local(Asset), + Local(PathBuf, u64), Remote(usize), } @@ -231,21 +234,3 @@ pub enum SourceTrackKind { }, Subtitle, } - -// TODO move this somewhere else -#[derive(Debug, Serialize, Deserialize, Clone, Copy, Hash, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TraktKind { - Movie, - Show, - Season, - Episode, - Person, - User, -} - -#[derive(Debug, Clone, Copy, Hash, Serialize, Deserialize)] -pub enum TmdbKind { - Tv, - Movie, -} |