Add the library trait
This commit is contained in:
parent
42a41feead
commit
5ee8afc4c4
@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
pub mod database;
|
pub mod database;
|
||||||
|
pub mod library;
|
||||||
|
|
||||||
/// [MusicBrainz Identifier](https://musicbrainz.org/doc/MusicBrainz_Identifier) (MBID).
|
/// [MusicBrainz Identifier](https://musicbrainz.org/doc/MusicBrainz_Identifier) (MBID).
|
||||||
pub type Mbid = Uuid;
|
pub type Mbid = Uuid;
|
||||||
|
17
src/library/mod.rs
Normal file
17
src/library/mod.rs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
use std::path::Path;
|
||||||
|
|
||||||
|
use crate::ReleaseGroup;
|
||||||
|
|
||||||
|
/// Options for refining library queries.
|
||||||
|
pub struct Query {
|
||||||
|
albumartist: Option<String>,
|
||||||
|
artist: Option<String>,
|
||||||
|
album: Option<String>,
|
||||||
|
track: Option<u32>,
|
||||||
|
title: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Trait for interacting with the music library.
|
||||||
|
pub trait Library {
|
||||||
|
fn list(&self, album: bool, path: Path, format: &str, query: Query) -> Vec<ReleaseGroup>;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user