From 5ee8afc4c40a6bd415d0d7b645e20bd6bd44e5a9 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Wed, 29 Mar 2023 18:00:32 +0900 Subject: [PATCH] Add the library trait --- src/lib.rs | 1 + src/library/mod.rs | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/library/mod.rs diff --git a/src/lib.rs b/src/lib.rs index 88c424c..78af023 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,6 +4,7 @@ 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; diff --git a/src/library/mod.rs b/src/library/mod.rs new file mode 100644 index 0000000..3183450 --- /dev/null +++ b/src/library/mod.rs @@ -0,0 +1,17 @@ +use std::path::Path; + +use crate::ReleaseGroup; + +/// Options for refining library queries. +pub struct Query { + albumartist: Option, + artist: Option, + album: Option, + track: Option, + title: Option, +} + +/// Trait for interacting with the music library. +pub trait Library { + fn list(&self, album: bool, path: Path, format: &str, query: Query) -> Vec; +}