refactor
This commit is contained in:
parent
29615d61eb
commit
bb4a3bc6cb
@ -426,8 +426,8 @@ auto s3_provider::get_directory_items_impl(const std::string &api_path,
|
||||
[this, &is_encrypted,
|
||||
&size](const directory_item &dir_item) -> std::uint64_t {
|
||||
std::string size_str;
|
||||
auto res = get_item_meta(dir_item.api_path, META_SIZE, size_str);
|
||||
if (res == api_error::success) {
|
||||
if (get_item_meta(dir_item.api_path, META_SIZE, size_str) ==
|
||||
api_error::success) {
|
||||
return utils::string::to_uint64(size_str);
|
||||
}
|
||||
|
||||
@ -460,17 +460,18 @@ auto s3_provider::get_file(const std::string &api_path, api_file &file) const
|
||||
file.api_parent = utils::path::get_parent_api_path(api_path);
|
||||
file.accessed_date = file.changed_date = file.creation_date =
|
||||
file.modified_date = result.last_modified;
|
||||
file.file_size =
|
||||
is_encrypted
|
||||
? utils::encryption::encrypting_reader::calculate_decrypted_size(
|
||||
result.content_length)
|
||||
: result.content_length;
|
||||
file.key = is_encrypted ? utils::path::create_api_path(api_path) : "";
|
||||
|
||||
std::string size_str;
|
||||
auto res = get_item_meta(file.api_path, META_SIZE, size_str);
|
||||
if (res == api_error::success) {
|
||||
if (get_item_meta(file.api_path, META_SIZE, size_str) ==
|
||||
api_error::success) {
|
||||
file.file_size = utils::string::to_uint64(size_str);
|
||||
} else {
|
||||
file.file_size =
|
||||
is_encrypted
|
||||
? utils::encryption::encrypting_reader::calculate_decrypted_size(
|
||||
result.content_length)
|
||||
: result.content_length;
|
||||
}
|
||||
|
||||
return add_if_not_found(file, object_name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user