give zipped files a containing directory to unzip into
This commit is contained in:
parent
faf018a0a5
commit
e05886aac5
6 changed files with 126 additions and 69 deletions
|
@ -114,7 +114,7 @@ async fn handle_download(
|
|||
if let Some(selection) = query.download {
|
||||
if let download::DownloadSelection::One(n) = selection {
|
||||
if let Some(ref files) = info.contents {
|
||||
if n >= files.len() {
|
||||
if n >= files.files.len() {
|
||||
return not_found(req, data, false);
|
||||
}
|
||||
} else {
|
||||
|
@ -129,7 +129,7 @@ async fn handle_download(
|
|||
}
|
||||
.into_response(&req))
|
||||
} else {
|
||||
let offsets = info.contents.as_deref().map(zip::file_data_offsets);
|
||||
let offsets = info.contents.as_ref().map(zip::file_data_offsets);
|
||||
Ok(DownloadPage {
|
||||
info: DownloadInfo {
|
||||
file: info,
|
||||
|
@ -167,7 +167,7 @@ async fn download_info(
|
|||
};
|
||||
|
||||
let storage_path = data.config.storage_dir.join(code);
|
||||
let offsets = info.contents.as_deref().map(zip::file_data_offsets);
|
||||
let offsets = info.contents.as_ref().map(zip::file_data_offsets);
|
||||
Ok(web::Json(DownloadInfo {
|
||||
file: info,
|
||||
code: code.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue