musichoard/src/lib.rs

34 lines
810 B
Rust

//! MusicHoard - a music collection manager.
use serde::{Deserialize, Serialize};
use uuid::Uuid;
pub mod database;
pub mod library;
/// [MusicBrainz Identifier](https://musicbrainz.org/doc/MusicBrainz_Identifier) (MBID).
pub type Mbid = Uuid;
/// A single track on an album.
#[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
pub struct Track {
pub number: u32,
pub title: String,
pub artist: Vec<String>,
}
/// The album identifier.
#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, Clone, Hash)]
pub struct AlbumId {
pub artist: String,
pub year: u32,
pub title: String,
}
/// An album is a collection of tracks that were released together.
#[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
pub struct Album {
pub id: AlbumId,
pub tracks: Vec<Track>,
}