src/catar/decoder.rs: simplify public restore API

This commit is contained in:
Dietmar Maurer
2019-03-11 14:31:01 +01:00
parent 8e39232acc
commit d5c34d98c0
4 changed files with 96 additions and 56 deletions

View File

@ -133,7 +133,13 @@ fn download_catar(
) -> Result<BoxFut, Error> {
let store = tools::required_string_param(&param, "store")?;
let archive_name = tools::required_string_param(&param, "archive-name")?;
let mut archive_name = tools::required_string_param(&param, "archive-name")?.to_owned();
if !archive_name.ends_with(".catar") {
bail!("wrong archive extension");
} else {
archive_name.push_str(".didx");
}
let backup_type = tools::required_string_param(&param, "backup-type")?;
let backup_id = tools::required_string_param(&param, "backup-id")?;