Move database implementation out of core
This commit is contained in:
parent
bd7e9ceb4d
commit
6d1194226d
@ -1,10 +1,5 @@
|
||||
//! Module for storing MusicHoard data in a database.
|
||||
|
||||
#[cfg(feature = "database-json")]
|
||||
pub mod json;
|
||||
#[cfg(feature = "database-json")]
|
||||
mod serde;
|
||||
|
||||
use std::fmt;
|
||||
|
||||
#[cfg(test)]
|
@ -3,7 +3,7 @@
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::core::database::json::IJsonDatabaseBackend;
|
||||
use crate::database::json::IJsonDatabaseBackend;
|
||||
|
||||
/// JSON database backend that uses a local file for persistent storage.
|
||||
pub struct JsonDatabaseFileBackend {
|
4
src/database/mod.rs
Normal file
4
src/database/mod.rs
Normal file
@ -0,0 +1,4 @@
|
||||
#[cfg(feature = "database-json")]
|
||||
pub mod json;
|
||||
#[cfg(feature = "database-json")]
|
||||
mod serde;
|
@ -1,11 +1,13 @@
|
||||
//! MusicHoard - a music collection manager.
|
||||
|
||||
mod core;
|
||||
pub mod database;
|
||||
|
||||
pub use core::collection;
|
||||
pub use core::database;
|
||||
pub use core::library;
|
||||
|
||||
pub use core::database::{IDatabase, NullDatabase};
|
||||
|
||||
pub use core::musichoard::{
|
||||
musichoard::{MusicHoard, NoDatabase, NoLibrary},
|
||||
musichoard_builder::MusicHoardBuilder,
|
||||
|
@ -10,10 +10,7 @@ use ratatui::{backend::CrosstermBackend, Terminal};
|
||||
use structopt::StructOpt;
|
||||
|
||||
use musichoard::{
|
||||
database::{
|
||||
json::{backend::JsonDatabaseFileBackend, JsonDatabase},
|
||||
IDatabase, NullDatabase,
|
||||
},
|
||||
database::json::{backend::JsonDatabaseFileBackend, JsonDatabase},
|
||||
library::{
|
||||
beets::{
|
||||
executor::{ssh::BeetsLibrarySshExecutor, BeetsLibraryProcessExecutor},
|
||||
@ -21,7 +18,7 @@ use musichoard::{
|
||||
},
|
||||
ILibrary, NullLibrary,
|
||||
},
|
||||
MusicHoardBuilder, NoDatabase, NoLibrary,
|
||||
IDatabase, MusicHoardBuilder, NoDatabase, NoLibrary, NullDatabase,
|
||||
};
|
||||
|
||||
use tui::{App, EventChannel, EventHandler, EventListener, Tui, Ui};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use musichoard::{collection::Collection, database::IDatabase, library::ILibrary, MusicHoard};
|
||||
use musichoard::{collection::Collection, library::ILibrary, IDatabase, MusicHoard};
|
||||
|
||||
#[cfg(test)]
|
||||
use mockall::automock;
|
||||
|
@ -5,10 +5,8 @@ use tempfile::NamedTempFile;
|
||||
|
||||
use musichoard::{
|
||||
collection::{album::AlbumDate, artist::Artist, Collection},
|
||||
database::{
|
||||
json::{backend::JsonDatabaseFileBackend, JsonDatabase},
|
||||
IDatabase,
|
||||
},
|
||||
database::json::{backend::JsonDatabaseFileBackend, JsonDatabase},
|
||||
IDatabase,
|
||||
};
|
||||
|
||||
use crate::testlib::COLLECTION;
|
||||
|
Loading…
Reference in New Issue
Block a user