mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
client: Store recordings that are from the server
This commit is contained in:
parent
46ff9bdad1
commit
51f2b34701
3 changed files with 34 additions and 1 deletions
|
|
@ -168,6 +168,17 @@ impl Database {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Check whether the database contains a recording.
|
||||
pub fn recording_exists(&self, id: &str) -> Result<bool> {
|
||||
let exists = recordings::table
|
||||
.filter(recordings::id.eq(id))
|
||||
.load::<RecordingRow>(&self.connection)?
|
||||
.first()
|
||||
.is_some();
|
||||
|
||||
Ok(exists)
|
||||
}
|
||||
|
||||
/// Retrieve all available information on a recording from related tables.
|
||||
fn get_recording_data(&self, row: RecordingRow) -> Result<Recording> {
|
||||
let mut performance_descriptions: Vec<Performance> = Vec::new();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue