refactor
This commit is contained in:
parent
366fe60e2f
commit
3e6ed45562
@ -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,
|
auto file_manager::handle_file_rename(const std::string &from_api_path,
|
||||||
const std::string &to_api_path)
|
const std::string &to_api_path)
|
||||||
-> api_error {
|
-> api_error {
|
||||||
auto should_upload{false};
|
|
||||||
std::string source_path{};
|
std::string source_path{};
|
||||||
auto file_iter = open_file_lookup_.find(from_api_path);
|
auto file_iter = open_file_lookup_.find(from_api_path);
|
||||||
if (file_iter != open_file_lookup_.end()) {
|
if (file_iter != open_file_lookup_.end()) {
|
||||||
source_path = file_iter->second->get_source_path();
|
source_path = file_iter->second->get_source_path();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not should_upload) {
|
auto should_upload{upload_lookup_.contains(from_api_path)};
|
||||||
should_upload = upload_lookup_.contains(from_api_path);
|
|
||||||
if (should_upload) {
|
if (should_upload) {
|
||||||
if (source_path.empty()) {
|
if (source_path.empty()) {
|
||||||
source_path = upload_lookup_.at(from_api_path)->get_source_path();
|
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>();
|
source_path = row->get_column("source_path").get_value<std::string>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
remove_upload(from_api_path);
|
remove_upload(from_api_path);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user