diff --git a/repertory/librepertory/src/providers/encrypt/encrypt_provider.cpp b/repertory/librepertory/src/providers/encrypt/encrypt_provider.cpp index f90e8976..2f444b8a 100644 --- a/repertory/librepertory/src/providers/encrypt/encrypt_provider.cpp +++ b/repertory/librepertory/src/providers/encrypt/encrypt_provider.cpp @@ -78,18 +78,14 @@ auto encrypt_provider::create_api_file( } api_file file{}; + file.accessed_date = times->get(utils::file::time_type::accessed); file.api_path = api_path; file.api_parent = utils::path::get_parent_api_path(api_path); - file.file_size = - directory - ? 0U - : utils::encryption::encrypting_reader::calculate_encrypted_size( - source_path); - file.source_path = source_path; - file.accessed_date = times->get(utils::file::time_type::accessed); file.changed_date = times->get(utils::file::time_type::modified); file.creation_date = times->get(utils::file::time_type::created); + file.file_size = directory ? 0U : utils::encryption::encrypting_reader::calculate_encrypted_size( source_path); file.modified_date = times->get(utils::file::time_type::written); + file.source_path = source_path; return file; } diff --git a/support/include/utils/file.hpp b/support/include/utils/file.hpp index 1d19035b..5b55904c 100644 --- a/support/include/utils/file.hpp +++ b/support/include/utils/file.hpp @@ -52,7 +52,7 @@ struct file_times final { return written; } - throw std::runtime_error("type_type not supported") : + throw std::runtime_error("type_type not supported"); } }; @@ -71,11 +71,11 @@ file_exists_in_path(std::string_view path, std::string_view file_name) -> bool; file_exists_in_path(std::wstring_view path, std::wstring_view file_name) -> bool; -[[nodiscard]] auto get_time(std::string_view path, time_type type) const - -> std::optional; +[[nodiscard]] auto get_time(std::string_view path, + time_type type) -> std::optional; -[[nodiscard]] auto get_time(std::wstring_view path, time_type type) const - -> std::optional; +[[nodiscard]] auto get_time(std::wstring_view path, + time_type type) -> std::optional; [[nodiscard]] auto get_times(std::string_view path) -> std::optional;