refine media-scanner-v2, when a folder scan done, insert items into db immediately 30/94830/2 accepted/tizen/common/20161103.155821 accepted/tizen/ivi/20161103.230335 accepted/tizen/mobile/20161103.230242 accepted/tizen/tv/20161103.230255 accepted/tizen/wearable/20161103.230315 submit/tizen/20161103.004541
authorbeibei.zhao <beibei.zhao@samsung.com>
Tue, 1 Nov 2016 10:25:02 +0000 (18:25 +0800)
committerbeibei.zhao <beibei.zhao@samsung.com>
Tue, 1 Nov 2016 10:33:20 +0000 (18:33 +0800)
Change-Id: Icc8fe5383e44925db403dea9df7e7bba5021f0b6

packaging/media-server.spec
src/scanner-v2/media-scanner-scan-v2.c

index 82ddb4a..587f744 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       media-server
 Summary:    A server for media content management
-Version:    0.3.7
+Version:    0.3.8
 Release:    0
 Group:      Multimedia/Service
 License:    Apache-2.0
index 18819c1..9f464a4 100755 (executable)
@@ -314,6 +314,9 @@ static int __msc_dir_scan_for_folder(void **handle, const char *storage_id, cons
                        }
                        goto STOP_SCAN;
                }
+
+               ms_bacth_commit_disable(handle, TRUE, TRUE, uid);
+               ms_bacth_commit_enable(handle, TRUE, TRUE, MS_NOTI_SWITCH_OFF, pid);
                /* get the current path from directory array */
                current_path = g_array_index(dir_array , char*, 0);
                g_array_remove_index (dir_array, 0);
@@ -542,6 +545,8 @@ END_SCAN:
 
        __msc_clear_file_list(dir_array);
 
+       ms_bacth_commit_disable(handle, TRUE, TRUE, uid);
+
        if (ret != MS_MEDIA_ERR_NONE) MS_DBG_INFO("ret : %d", ret);
 
        return ret;
@@ -601,6 +606,10 @@ static int __msc_dir_scan_for_storage(void **handle, const char *storage_id, con
                if (ret != MS_MEDIA_ERR_NONE) {
                        goto STOP_SCAN;
                }
+
+               ms_bacth_commit_disable(handle, TRUE, TRUE, uid);
+               ms_bacth_commit_enable(handle, TRUE, TRUE, MS_NOTI_SWITCH_OFF, pid);
+
                /* get the current path from directory array */
                current_path = g_array_index(dir_array , char*, 0);
                g_array_remove_index(dir_array, 0);
@@ -833,7 +842,7 @@ STOP_SCAN:
                ms_set_folder_scan_status(handle, storage_id, current_path, MS_DIR_SCAN_STOP, uid);
 
 EXIT:
-       
+
        if (fd != -1) {
                close(fd);
                fd = -1;
@@ -843,6 +852,8 @@ EXIT:
        __msc_set_storage_scan_cur_path(NULL);
        __msc_clear_file_list(dir_array);
 
+       ms_bacth_commit_disable(handle, TRUE, TRUE, uid);
+
        if (ret != MS_MEDIA_ERR_NONE) MS_DBG_INFO("ret : %d", ret);
 
        return ret;