This commit is contained in:
2024-08-02 21:30:17 -05:00
parent e37a375c18
commit c0dba76ecd
5 changed files with 46 additions and 57 deletions

View File

@ -159,20 +159,20 @@ auto app_config::default_data_directory(const provider_type &prov)
});
#else
#if defined(__APPLE__)
auto data_directory = utils::path::resolve(
auto data_directory =
utils::path::combine("~", {
"Library",
"Application Support",
REPERTORY_DATA_NAME,
app_config::get_provider_name(prov),
}));
});
#else
auto data_directory = utils::path::resolve(
auto data_directory =
utils::path::combine("~", {
".local",
REPERTORY_DATA_NAME,
app_config::get_provider_name(prov),
}));
});
#endif
#endif
return data_directory;
@ -327,18 +327,25 @@ auto app_config::get_max_cache_size_bytes() const -> std::uint64_t {
auto app_config::get_provider_api_password(const provider_type &prov)
-> std::string {
#if defined(_WIN32)
auto api_file =
utils::path::combine(utils::get_local_app_data_directory(),
{get_provider_display_name(prov), "apipassword"});
auto api_file = utils::path::combine(utils::get_local_app_data_directory(),
{
get_provider_display_name(prov),
"apipassword",
});
#else
#if defined(__APPLE__)
auto api_file =
utils::path::combine(utils::path::resolve("~"),
{"/Library/Application Support",
get_provider_display_name(prov), "apipassword"});
auto api_file = utils::path::combine("~", {
"/",
"Library",
"Application Support",
get_provider_display_name(prov),
"apipassword",
});
#else
auto api_file = utils::path::combine(
utils::path::resolve("~/."), {get_provider_name(prov), "apipassword"});
auto api_file = utils::path::combine("~/.", {
get_provider_name(prov),
"apipassword",
});
#endif
#endif
auto lines = utils::file::read_file_lines(api_file);

View File

@ -93,11 +93,11 @@ auto lock_data::get_mount_state(json &mount_state) -> bool {
auto lock_data::get_state_directory() -> std::string {
#if defined(__APPLE__)
return utils::path::resolve("~/Library/Application Support/" +
std::string{REPERTORY_DATA_NAME} + "/state");
return utils::path::absolute("~/Library/Application Support/" +
std::string{REPERTORY_DATA_NAME} + "/state");
#else
return utils::path::resolve("~/.local/" + std::string{REPERTORY_DATA_NAME} +
"/state");
return utils::path::absolute("~/.local/" + std::string{REPERTORY_DATA_NAME} +
"/state");
#endif
}