diff --git a/repertory/librepertory/include/common.hpp b/repertory/librepertory/include/common.hpp index 7c92b326..9774b3f4 100644 --- a/repertory/librepertory/include/common.hpp +++ b/repertory/librepertory/include/common.hpp @@ -54,12 +54,13 @@ REPERTORY_IGNORE_WARNINGS_DISABLE() using namespace std::chrono_literals; using json = nlohmann::json; -inline constexpr const std::string_view REPERTORY = "repertory"; -inline constexpr const std::wstring_view REPERTORY_W = L"repertory"; +inline constexpr const std::string_view REPERTORY{"repertory"}; +inline constexpr const std::string_view REPERTORY_DATA_NAME{"repertory2"}; +inline constexpr const std::wstring_view REPERTORY_W{L"repertory"}; -inline constexpr const std::uint64_t REPERTORY_CONFIG_VERSION = 2ULL; -inline constexpr const std::string_view REPERTORY_DATA_NAME = "repertory2"; -inline constexpr const std::string_view REPERTORY_MIN_REMOTE_VERSION = "2.0.0"; +inline constexpr const std::uint64_t REPERTORY_CONFIG_VERSION{2ULL}; +inline constexpr const std::string_view REPERTORY_MIN_REMOTE_VERSION{"2.0.0"}; +inline constexpr const std::string_view RENTERD_MIN_VERSION{"2.0.0"}; #define REPERTORY_INVALID_HANDLE INVALID_HANDLE_VALUE diff --git a/repertory/librepertory/src/providers/sia/sia_provider.cpp b/repertory/librepertory/src/providers/sia/sia_provider.cpp index 5217a140..aea2befb 100644 --- a/repertory/librepertory/src/providers/sia/sia_provider.cpp +++ b/repertory/librepertory/src/providers/sia/sia_provider.cpp @@ -67,7 +67,7 @@ auto sia_provider::check_version(std::string &required_version, std::string &returned_version) const -> bool { REPERTORY_USES_FUNCTION_NAME(); - required_version = "2.0.0"; + required_version = RENTERD_MIN_VERSION; try { curl::requests::http_get get{}; @@ -240,7 +240,25 @@ auto sia_provider::get_directory_items_impl(const std::string &api_path, directory ? 0U : entry["size"].get(), get_last_modified(entry)); + if (directory) { + bool exists{}; + auto res{is_directory(entry_api_path, exists)}; + if (res != api_error::success) { + utils::error::raise_api_path_error( + function_name, entry_api_path, res, + "failed detect existing directory"); + continue; + } + + if (not exists) { + utils::error::raise_api_path_error(function_name, entry_api_path, + res, "directory not found"); + continue; + } + } + get_api_item_added()(directory, file); + auto res{get_item_meta(entry_api_path, meta)}; if (res != api_error::success) { utils::error::raise_api_path_error(function_name, entry_api_path,