Remove the need for a directory for db export

Plus on import use the context directory.  We can actually write there
just fine.
This commit is contained in:
Floris Bruynooghe
2023-02-16 16:06:41 +01:00
parent dcce6ef50b
commit 490a14c5ef
9 changed files with 48 additions and 48 deletions

View File

@@ -1,5 +1,4 @@
use std::collections::BTreeMap;
use std::path::Path;
use std::sync::Arc;
use std::{collections::HashMap, str::FromStr};
@@ -1351,10 +1350,10 @@ impl CommandApi {
/// This **stops IO**. After completion `start_io` must be called to restart IO.
///
/// Returns the QR code as a rendered SVG image.
async fn provide_backup(&self, account_id: u32, path: String) -> Result<String> {
async fn provide_backup(&self, account_id: u32) -> Result<String> {
let ctx = self.get_context(account_id).await?;
ctx.stop_io().await;
let provider = imex::BackupProvider::prepare(&ctx, Path::new(&path)).await?;
let provider = imex::BackupProvider::prepare(&ctx).await?;
let qr = provider.qr();
let svg = match generate_backup_qr(&ctx, &qr).await {
Ok(svg) => svg,