mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-25 20:37:24 +02:00
library: Remove unused functions
This commit is contained in:
parent
1f7d004c7e
commit
e5e41619f2
1 changed files with 1 additions and 93 deletions
|
|
@ -758,14 +758,6 @@ impl Library {
|
|||
Ok(persons)
|
||||
}
|
||||
|
||||
pub fn all_persons(&self) -> Result<Vec<Person>> {
|
||||
let connection = &mut *self.imp().connection.get().unwrap().lock().unwrap();
|
||||
|
||||
let persons = persons::table.order(persons::name).load(connection)?;
|
||||
|
||||
Ok(persons)
|
||||
}
|
||||
|
||||
pub fn search_roles(&self, search: &str) -> Result<Vec<Role>> {
|
||||
let search = format!("%{}%", search);
|
||||
let connection = &mut *self.imp().connection.get().unwrap().lock().unwrap();
|
||||
|
|
@ -779,14 +771,6 @@ impl Library {
|
|||
Ok(roles)
|
||||
}
|
||||
|
||||
pub fn all_roles(&self) -> Result<Vec<Role>> {
|
||||
let connection = &mut *self.imp().connection.get().unwrap().lock().unwrap();
|
||||
|
||||
let roles = roles::table.order(roles::name).load(connection)?;
|
||||
|
||||
Ok(roles)
|
||||
}
|
||||
|
||||
pub fn search_instruments(&self, search: &str) -> Result<Vec<Instrument>> {
|
||||
let search = format!("%{}%", search);
|
||||
let connection = &mut *self.imp().connection.get().unwrap().lock().unwrap();
|
||||
|
|
@ -800,16 +784,6 @@ impl Library {
|
|||
Ok(instruments)
|
||||
}
|
||||
|
||||
pub fn all_instruments(&self) -> Result<Vec<Instrument>> {
|
||||
let connection = &mut *self.imp().connection.get().unwrap().lock().unwrap();
|
||||
|
||||
let instruments = instruments::table
|
||||
.order(instruments::name)
|
||||
.load(connection)?;
|
||||
|
||||
Ok(instruments)
|
||||
}
|
||||
|
||||
pub fn search_works(&self, composer: &Person, search: &str) -> Result<Vec<Work>> {
|
||||
let search = format!("%{}%", search);
|
||||
let connection = &mut *self.imp().connection.get().unwrap().lock().unwrap();
|
||||
|
|
@ -857,19 +831,6 @@ impl Library {
|
|||
Ok(recordings)
|
||||
}
|
||||
|
||||
pub fn all_works(&self) -> Result<Vec<Work>> {
|
||||
let connection = &mut *self.imp().connection.get().unwrap().lock().unwrap();
|
||||
|
||||
let works = works::table
|
||||
.order(works::name)
|
||||
.load::<tables::Work>(connection)?
|
||||
.into_iter()
|
||||
.map(|w| Work::from_table(w, connection))
|
||||
.collect::<Result<Vec<Work>>>()?;
|
||||
|
||||
Ok(works)
|
||||
}
|
||||
|
||||
pub fn search_ensembles(&self, search: &str) -> Result<Vec<Ensemble>> {
|
||||
let search = format!("%{}%", search);
|
||||
let connection = &mut *self.imp().connection.get().unwrap().lock().unwrap();
|
||||
|
|
@ -892,60 +853,6 @@ impl Library {
|
|||
Ok(ensembles)
|
||||
}
|
||||
|
||||
pub fn all_ensembles(&self) -> Result<Vec<Ensemble>> {
|
||||
let connection = &mut *self.imp().connection.get().unwrap().lock().unwrap();
|
||||
|
||||
let ensembles = ensembles::table
|
||||
.order(ensembles::name)
|
||||
.load::<tables::Ensemble>(connection)?
|
||||
.into_iter()
|
||||
.map(|e| Ensemble::from_table(e, connection))
|
||||
.collect::<Result<Vec<Ensemble>>>()?;
|
||||
|
||||
Ok(ensembles)
|
||||
}
|
||||
|
||||
pub fn all_recordings(&self) -> Result<Vec<Recording>> {
|
||||
let connection = &mut *self.imp().connection.get().unwrap().lock().unwrap();
|
||||
|
||||
let recordings = recordings::table
|
||||
.load::<tables::Recording>(connection)?
|
||||
.into_iter()
|
||||
.map(|e| Recording::from_table(e, connection))
|
||||
.collect::<Result<Vec<Recording>>>()?;
|
||||
|
||||
Ok(recordings)
|
||||
}
|
||||
|
||||
pub fn all_tracks(&self) -> Result<Vec<Track>> {
|
||||
let connection = &mut *self.imp().connection.get().unwrap().lock().unwrap();
|
||||
|
||||
let tracks = tracks::table
|
||||
.load::<tables::Track>(connection)?
|
||||
.into_iter()
|
||||
.map(|e| Track::from_table(e, connection))
|
||||
.collect::<Result<Vec<Track>>>()?;
|
||||
|
||||
Ok(tracks)
|
||||
}
|
||||
|
||||
pub fn all_mediums(&self) -> Result<Vec<tables::Medium>> {
|
||||
// TODO
|
||||
Ok(vec![])
|
||||
}
|
||||
|
||||
pub fn all_albums(&self) -> Result<Vec<Album>> {
|
||||
let connection = &mut *self.imp().connection.get().unwrap().lock().unwrap();
|
||||
|
||||
let albums = albums::table
|
||||
.load::<tables::Album>(connection)?
|
||||
.into_iter()
|
||||
.map(|a| Album::from_table(a, connection))
|
||||
.collect::<Result<Vec<Album>>>()?;
|
||||
|
||||
Ok(albums)
|
||||
}
|
||||
|
||||
pub fn composer_default_role(&self) -> Result<Role> {
|
||||
let connection = &mut *self.imp().connection.get().unwrap().lock().unwrap();
|
||||
|
||||
|
|
@ -1864,6 +1771,7 @@ fn add_file_to_zip(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// TODO: Add options whether to keep stats.
|
||||
fn import_from_zip(
|
||||
zip_path: impl AsRef<Path>,
|
||||
library_folder: impl AsRef<Path>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue