make cosmetic changes to state schema, add fileset passwords for forthcoming functionality
This commit is contained in:
parent
073feda920
commit
aef58d133b
9 changed files with 327 additions and 119 deletions
17
src/zip.rs
17
src/zip.rs
|
|
@ -2,7 +2,6 @@ use std::io::Write;
|
|||
|
||||
use crc32fast::Hasher;
|
||||
use log::debug;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use time::OffsetDateTime;
|
||||
|
||||
use crate::upload::UploadedFile;
|
||||
|
|
@ -28,21 +27,7 @@ const EOCD_TOTAL_SIZE: u64 = EOCD64_RECORD_SIZE + EOCD64_LOCATOR_SIZE + EOCD_REC
|
|||
|
||||
const EMPTY_STRING_CRC32: u32 = 0;
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct FileSet {
|
||||
pub files: Vec<UploadedFile>,
|
||||
// Optional for backwards compatibility only
|
||||
pub directory_name: Option<String>,
|
||||
}
|
||||
|
||||
impl From<Vec<UploadedFile>> for FileSet {
|
||||
fn from(files: Vec<UploadedFile>) -> Self {
|
||||
Self {
|
||||
files,
|
||||
directory_name: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
pub use crate::state::v1::FileSet;
|
||||
|
||||
fn full_file_name_len(file: &UploadedFile, directory_name: &Option<String>) -> u64 {
|
||||
file.name.len() as u64
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue