Break down the musichoard files #165
@ -207,8 +207,7 @@ impl<LIB: ILibrary> MusicHoard<LIB, NoDatabase> {
|
|||||||
/// Rescan the library and merge with the in-memory collection.
|
/// Rescan the library and merge with the in-memory collection.
|
||||||
pub fn rescan_library(&mut self) -> Result<(), Error> {
|
pub fn rescan_library(&mut self) -> Result<(), Error> {
|
||||||
self.pre_commit = self.rescan_library_inner()?;
|
self.pre_commit = self.rescan_library_inner()?;
|
||||||
self.collection = self.pre_commit.clone();
|
self.commit()
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,6 +237,13 @@ impl<DB: IDatabase> MusicHoard<NoLibrary, DB> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<LIB> MusicHoard<LIB, NoDatabase> {
|
||||||
|
fn commit(&mut self) -> Result<(), Error> {
|
||||||
|
self.collection = self.pre_commit.clone();
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<LIB, DB: IDatabase> MusicHoard<LIB, DB> {
|
impl<LIB, DB: IDatabase> MusicHoard<LIB, DB> {
|
||||||
/// Load the database and merge with the in-memory collection.
|
/// Load the database and merge with the in-memory collection.
|
||||||
pub fn reload_database(&mut self) -> Result<(), Error> {
|
pub fn reload_database(&mut self) -> Result<(), Error> {
|
||||||
|
Loading…
Reference in New Issue
Block a user