mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
Add empty page offering download
This commit is contained in:
parent
bf1ffef05a
commit
424c4c57a8
10 changed files with 295 additions and 9 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue