Output path fixes.

This commit is contained in:
J-D-K 2025-08-22 17:22:56 -04:00
parent 68fcf79cf5
commit 01a7b8467d
3 changed files with 5 additions and 6 deletions

View File

@ -75,7 +75,7 @@ namespace config
bool has_custom_path(uint64_t applicationID) const;
/// @brief Adds a new output path.
void add_custom_path(uint64_t applicationID, const fslib::Path &path);
void add_custom_path(uint64_t applicationID, std::string_view newPath);
/// @brief Gets the custom output path of the applicationID passed.
void get_custom_path(uint64_t applicationID, char *buffer, size_t bufferSize);

View File

@ -175,7 +175,7 @@ void TitleOptionState::change_output_directory()
const fslib::Path newPath = workDir / pathBuffer.data();
const bool oldExists = fslib::directory_exists(oldPath);
const bool renameFailed = oldExists && error::fslib(fslib::rename_directory(oldPath, newPath));
if (!autoUpload && (!oldExists || renameFailed)) { ui::PopMessageManager::push_message(popTicks, popFailed); }
if (oldExists && renameFailed) { ui::PopMessageManager::push_message(popTicks, popFailed); }
// Need to change WebDav to match.
remote::Storage *remote = remote::get_remote_storage();

View File

@ -158,10 +158,9 @@ bool config::ConfigContext::has_custom_path(uint64_t applicationID) const
return m_paths.find(applicationID) != m_paths.end();
}
void config::ConfigContext::add_custom_path(uint64_t applicationID, const fslib::Path &path)
void config::ConfigContext::add_custom_path(uint64_t applicationID, std::string_view newPath)
{
if (!path.is_valid()) { return; }
m_paths[applicationID] = path.full_path();
m_paths[applicationID] = newPath;
ConfigContext::save_custom_paths();
}
@ -288,7 +287,7 @@ void config::ConfigContext::load_custom_paths()
void config::ConfigContext::save_custom_paths()
{
json::Object pathsJSON = json::new_object(json_object_from_file, PATH_PATHS_FILE.data());
json::Object pathsJSON = json::new_object(json_object_new_object);
if (!pathsJSON) { return; }
for (auto &[applicationID, path] : m_paths)