11
This commit is contained in:
@@ -58,8 +58,21 @@ impl AudioStore {
|
||||
self.with_db(|db| db.list().map_err(|e| e.to_string())).await
|
||||
}
|
||||
|
||||
pub async fn insert(&self, name: String, file_path: String) -> Result<GeneratedAudioRecord, String> {
|
||||
self.with_db(move |db| db.insert(&name, &file_path).map_err(|e| e.to_string()))
|
||||
pub async fn insert(
|
||||
&self,
|
||||
name: String,
|
||||
file_path: String,
|
||||
source_text: String,
|
||||
) -> Result<GeneratedAudioRecord, String> {
|
||||
self.with_db(move |db| {
|
||||
db.insert(&name, &file_path, &source_text)
|
||||
.map_err(|e| e.to_string())
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn update_name(&self, id: i64, name: String) -> Result<(), String> {
|
||||
self.with_db(move |db| db.update_name(id, &name).map_err(|e| e.to_string()))
|
||||
.await
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user