diff --git a/src/core/musichoard/musichoard.rs b/src/core/musichoard/musichoard.rs index 6d11e15..191722c 100644 --- a/src/core/musichoard/musichoard.rs +++ b/src/core/musichoard/musichoard.rs @@ -207,8 +207,7 @@ impl MusicHoard { /// Rescan the library and merge with the in-memory collection. pub fn rescan_library(&mut self) -> Result<(), Error> { self.pre_commit = self.rescan_library_inner()?; - self.collection = self.pre_commit.clone(); - Ok(()) + self.commit() } } @@ -238,6 +237,13 @@ impl MusicHoard { } } +impl MusicHoard { + fn commit(&mut self) -> Result<(), Error> { + self.collection = self.pre_commit.clone(); + Ok(()) + } +} + impl MusicHoard { /// Load the database and merge with the in-memory collection. pub fn reload_database(&mut self) -> Result<(), Error> {