This commit is contained in:
parent
ba2a669be6
commit
1aef67368b
@ -326,7 +326,7 @@ auto s3_provider::get_directory_items_impl(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto add_directory_item =
|
const auto add_directory_item =
|
||||||
[&](bool directory, const std::string &name, std::uint64_t last_modified,
|
[&](bool directory, const std::string &name,
|
||||||
std::function<std::uint64_t(const directory_item &)> get_size)
|
std::function<std::uint64_t(const directory_item &)> get_size)
|
||||||
-> api_error {
|
-> api_error {
|
||||||
auto child_api_path =
|
auto child_api_path =
|
||||||
@ -355,7 +355,7 @@ auto s3_provider::get_directory_items_impl(
|
|||||||
} else {
|
} else {
|
||||||
auto file =
|
auto file =
|
||||||
create_api_file(child_api_path, child_object_name, dir_item.size,
|
create_api_file(child_api_path, child_object_name, dir_item.size,
|
||||||
get_last_modified(true, child_api_path));
|
get_last_modified(directory, child_api_path));
|
||||||
ret = add_if_not_found(file, child_object_name);
|
ret = add_if_not_found(file, child_object_name);
|
||||||
if (ret != api_error::success) {
|
if (ret != api_error::success) {
|
||||||
return ret;
|
return ret;
|
||||||
@ -376,7 +376,7 @@ auto s3_provider::get_directory_items_impl(
|
|||||||
auto node_list = doc.select_nodes("/ListBucketResult/CommonPrefixes/Prefix");
|
auto node_list = doc.select_nodes("/ListBucketResult/CommonPrefixes/Prefix");
|
||||||
for (auto &&node : node_list) {
|
for (auto &&node : node_list) {
|
||||||
add_directory_item(
|
add_directory_item(
|
||||||
true, node.node().text().as_string(), utils::time::get_time_now(),
|
true, node.node().text().as_string(),
|
||||||
[](const directory_item &) -> std::uint64_t { return 0U; });
|
[](const directory_item &) -> std::uint64_t { return 0U; });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,10 +386,8 @@ auto s3_provider::get_directory_items_impl(
|
|||||||
node.node().select_node("Key").node().text().as_string());
|
node.node().select_node("Key").node().text().as_string());
|
||||||
if (child_object_name != utils::path::create_api_path(prefix)) {
|
if (child_object_name != utils::path::create_api_path(prefix)) {
|
||||||
auto size = node.node().select_node("Size").node().text().as_ullong();
|
auto size = node.node().select_node("Size").node().text().as_ullong();
|
||||||
auto last_modified = convert_api_date(
|
|
||||||
node.node().select_node("LastModified").node().text().as_string());
|
|
||||||
add_directory_item(
|
add_directory_item(
|
||||||
false, child_object_name, last_modified,
|
false, child_object_name,
|
||||||
[&is_encrypted, &size](const directory_item &) -> std::uint64_t {
|
[&is_encrypted, &size](const directory_item &) -> std::uint64_t {
|
||||||
return is_encrypted ? utils::encryption::encrypting_reader::
|
return is_encrypted ? utils::encryption::encrypting_reader::
|
||||||
calculate_decrypted_size(size)
|
calculate_decrypted_size(size)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user