Remove plugin API for folder batch insertion 93/237293/5 accepted/tizen/unified/20200630.131147 submit/tizen/20200630.065716
authorMinje Ahn <minje.ahn@samsung.com>
Mon, 29 Jun 2020 01:19:59 +0000 (10:19 +0900)
committerMinje ahn <minje.ahn@samsung.com>
Tue, 30 Jun 2020 01:58:55 +0000 (01:58 +0000)
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 <minje.ahn@samsung.com>
src/media_folder.c

index 91b2354..d190f45 100755 (executable)
@@ -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);