Add empty page offering download

This commit is contained in:
Elias Projahn 2025-03-23 16:04:14 +01:00
parent bf1ffef05a
commit 424c4c57a8
10 changed files with 295 additions and 9 deletions

View file

@ -77,6 +77,16 @@ impl Library {
Ok(obj)
}
/// Whether this library is empty. The library is considered empty, if
/// there are no tracks.
pub fn is_empty(&self) -> Result<bool> {
let connection = &mut *self.imp().connection.get().unwrap().lock().unwrap();
Ok(tracks::table
.first::<tables::Track>(connection)
.optional()?
.is_none())
}
/// Import from a library archive.
pub fn import_archive(
&self,