}
metadata_extractor_h extractor;
- metadata_extractor_create(&extractor);
+ ret = metadata_extractor_create(&extractor);
+ if (METADATA_EXTRACTOR_ERROR_NONE != ret) {
- LOGGER(ERROR) << "metadata_extractor_create failed, error: " << ret;
++ LoggerE("metadata_extractor_create failed, error: %d", ret);
+ }
std::unique_ptr<std::remove_pointer<metadata_extractor_h>::type, int (*)(metadata_extractor_h)>
extractor_ptr(extractor, &metadata_extractor_destroy); // automatically release the memory
LoggerW("%s", get_error_message(ret));
}
out["status"] = picojson::value("completed");
+ out["fullPath"] =
+ picojson::value(common::FilesystemProvider::Create().GetVirtualPath(fullPath));
}
-
- out["callbackId"] = picojson::value(static_cast<double>(callback_id));
+ out["downloadId"] = picojson::value(static_cast<double>(download_id));
- out["fullPath"] = picojson::value(common::FilesystemProvider::Create().GetVirtualPath(fullPath));
- Instance::PostMessage(downCbPtr->instance, picojson::value(out).serialize().c_str());
- // downCbPtr is freed in destructor, it prevent from crash if OnFinished state
+ out["listenerId"] = picojson::value(kDownloadManagerListenerId);
-
+ Instance::PostMessage(down_cb_ptr->instance, picojson::value(out).serialize().c_str());
+ // down_cb_ptr is freed in destructor, it prevent from crash if OnFinished state
// was called after OnCanceled or OnFailed
free(fullPath);