This commit is contained in:
Scott E. Graves 2024-10-02 11:11:57 -05:00
parent 366fe60e2f
commit 3e6ed45562

View File

@ -378,15 +378,13 @@ auto file_manager::get_stored_downloads() const -> std::vector<json> {
auto file_manager::handle_file_rename(const std::string &from_api_path,
const std::string &to_api_path)
-> api_error {
auto should_upload{false};
std::string source_path{};
auto file_iter = open_file_lookup_.find(from_api_path);
if (file_iter != open_file_lookup_.end()) {
source_path = file_iter->second->get_source_path();
}
if (not should_upload) {
should_upload = upload_lookup_.contains(from_api_path);
auto should_upload{upload_lookup_.contains(from_api_path)};
if (should_upload) {
if (source_path.empty()) {
source_path = upload_lookup_.at(from_api_path)->get_source_path();
@ -403,7 +401,6 @@ auto file_manager::handle_file_rename(const std::string &from_api_path,
source_path = row->get_column("source_path").get_value<std::string>();
}
}
}
remove_upload(from_api_path);