fix
This commit is contained in:
@@ -847,23 +847,19 @@ auto base_provider::set_item_meta(const std::string &api_path,
|
||||
|
||||
auto base_provider::set_item_meta(const std::string &api_path,
|
||||
api_meta_map meta) -> api_error {
|
||||
if (meta.contains(META_PINNED)) {
|
||||
auto res = set_item_meta(api_path, META_PINNED, meta.at(META_PINNED));
|
||||
if (res != api_error::success) {
|
||||
return res;
|
||||
}
|
||||
|
||||
meta.erase(META_PINNED);
|
||||
if (meta.empty()) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
auto ret = meta_db_->set_item_meta(api_path, meta);
|
||||
if (ret != api_error::success) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (meta.contains(META_PINNED) &&
|
||||
utils::string::to_bool(meta.at(META_PINNED))) {
|
||||
if (fm_ == nullptr || not fm_->download_pinned_file(api_path)) {
|
||||
// TODO handle error
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user