refactor
This commit is contained in:
		| @@ -457,26 +457,31 @@ void base_provider::remove_deleted_files() { | ||||
|  | ||||
|   for (auto &&api_path : db3_->get_api_path_list()) { | ||||
|     api_meta_map meta{}; | ||||
|     if (get_item_meta(api_path, meta) == api_error::success) { | ||||
|       if (utils::string::to_bool(meta[META_DIRECTORY])) { | ||||
|         bool exists{}; | ||||
|         if (is_directory(api_path, exists) != api_error::success) { | ||||
|           continue; | ||||
|         } | ||||
|         if (not exists) { | ||||
|           removed_list.emplace_back(removed_item{api_path, true, ""}); | ||||
|         } | ||||
|     if (get_item_meta(api_path, meta) != api_error::success) { | ||||
|       continue; | ||||
|     } | ||||
|  | ||||
|     if (utils::string::to_bool(meta[META_DIRECTORY])) { | ||||
|       bool exists{}; | ||||
|       if (is_directory(api_path, exists) != api_error::success) { | ||||
|         continue; | ||||
|       } | ||||
|  | ||||
|       bool exists{}; | ||||
|       if (is_file(api_path, exists) != api_error::success) { | ||||
|         continue; | ||||
|       } | ||||
|       if (not exists) { | ||||
|         removed_list.emplace_back( | ||||
|             removed_item{api_path, false, meta[META_SOURCE]}); | ||||
|         removed_list.emplace_back(removed_item{api_path, true, ""}); | ||||
|       } | ||||
|  | ||||
|       continue; | ||||
|     } | ||||
|  | ||||
|     bool exists{}; | ||||
|     if (is_file(api_path, exists) != api_error::success) { | ||||
|       continue; | ||||
|     } | ||||
|  | ||||
|     if (not exists) { | ||||
|       removed_list.emplace_back( | ||||
|           removed_item{api_path, false, meta[META_SOURCE]}); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user