Change API used to delete invalid items 87/146687/1
authorMinje Ahn <minje.ahn@samsung.com>
Wed, 30 Aug 2017 05:04:54 +0000 (14:04 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Wed, 30 Aug 2017 05:04:54 +0000 (14:04 +0900)
Change-Id: I937502b3d521502b9034980cc21f5a6e493ce39d
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/scanner/media-scanner-scan.c

index 7b9aae2..2f276d9 100755 (executable)
@@ -213,7 +213,6 @@ gboolean msc_directory_scan_thread(void *data)
        char *start_path = NULL;
        ms_user_storage_type_e storage_type;
        ms_noti_type_e noti_type = MS_ITEM_INSERT;
-       int delete_folder_count = 0;
        char *folder_uuid = NULL;
 
        while (1) {
@@ -311,13 +310,12 @@ gboolean msc_directory_scan_thread(void *data)
 
                ms_bacth_commit_disable(handle, TRUE, TRUE, scan_data->uid);
 
-               if (ms_delete_invalid_items_in_folder(handle, storage_id, scan_data->msg, is_recursive, scan_data->uid) != MS_MEDIA_ERR_NONE) {
-                       MS_DBG_ERR("deleting invalid items in folder failed");
+               if (!ms_delete_invalid_items(handle, storage_id, storage_type, scan_data->uid)) {
+                       MS_DBG_ERR("deleting invalid items in storage failed");
                }
 
-               /*remove invalid folder in folder table.*/
-               if (ms_delete_invalid_folder_by_path(handle, storage_id, scan_data->msg, scan_data->uid, &delete_folder_count) != MS_MEDIA_ERR_NONE) {
-                       MS_DBG_ERR("deleting invalid folder failed");
+               if (ms_delete_invalid_folder(handle, storage_id, storage_type, scan_data->uid) != MS_MEDIA_ERR_NONE) {
+                       MS_DBG_ERR("deleting invalid folders in storage failed");
                }
 
                if (ret != MS_MEDIA_ERR_SCANNER_FORCE_STOP) {