client: Store recordings that are from the server

This commit is contained in:
Elias Projahn 2020-11-29 10:01:34 +01:00
parent 46ff9bdad1
commit 51f2b34701
3 changed files with 34 additions and 1 deletions

View file

@ -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();