From 05f99f8f2009914416a63293f8694e7b88c5ee39 Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Mon, 29 Jun 2020 10:19:59 +0900 Subject: [PATCH 1/1] Remove plugin API for folder batch insertion This patch changes media-scanner-v2 to write directly to media.db. It makes better performance than bulk insert through IPC. Change-Id: I0d42e1029b6d56fddd7f50d52a00e4f48c9b7542 Signed-off-by: Minje Ahn --- src/media_folder.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/media_folder.c b/src/media_folder.c index 91b2354..d190f45 100755 --- a/src/media_folder.c +++ b/src/media_folder.c @@ -338,7 +338,7 @@ int media_folder_insert_to_db(const char *path) return _content_error_capi(ret); } - ret = media_svc_insert_folder(_content_get_db_handle(), storage_id, storage_type, repl_path, _content_get_uid()); + ret = media_svc_insert_folder(_content_get_db_handle(), storage_id, storage_type, repl_path, false, _content_get_uid()); if (ret != MS_MEDIA_ERR_NONE) { if (ret == MS_MEDIA_ERR_DB_CONSTRAINT_FAIL) { content_sec_error("This item is already inserted. This may be normal operation because other process already did this (%s)", repl_path); @@ -350,7 +350,7 @@ int media_folder_insert_to_db(const char *path) return _content_error_capi(ret); } - ret = media_svc_set_folder_scan_status(storage_id, repl_path, MEDIA_DIR_SCAN_DONE, _content_get_uid()); + ret = media_svc_set_folder_scan_status(storage_id, repl_path, MEDIA_DIR_SCAN_DONE, false, _content_get_uid()); if (ret != MS_MEDIA_ERR_NONE) { content_sec_error("ms_set_folder_scan_status failed : %d", ret); return _content_error_capi(ret); @@ -395,7 +395,7 @@ int media_folder_reset_scan_status(const char *storage_uuid, const char* path) return _content_error_capi(ret); } - ret = media_svc_set_folder_scan_status(storage_uuid, path, MEDIA_DIR_SCAN_NONE, _content_get_uid()); + ret = media_svc_set_folder_scan_status(storage_uuid, path, MEDIA_DIR_SCAN_NONE, false, _content_get_uid()); if (ret != MS_MEDIA_ERR_NONE) { content_error("media_folder_reset_scan_status failed"); return _content_error_capi(ret); -- 2.7.4