when db size max then 10M, sometimes it will have no content found issue 00/95900/1
authorbeibei.zhao <beibei.zhao@samsung.com>
Fri, 4 Nov 2016 07:30:45 +0000 (15:30 +0800)
committerYong Yeon Kim <yy9875.kim@samsung.com>
Mon, 7 Nov 2016 05:12:29 +0000 (21:12 -0800)
Change-Id: Ibcc447463a544bdd8bac2c2c7540f655cc59e8ec

packaging/media-server.spec
src/server/media-server-device-block.c

index 3b0e04f..6c8a487 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       media-server
 Summary:    A server for media content management
-Version:    0.3.9
+Version:    0.3.10
 Release:    0
 Group:      Multimedia/Service
 License:    Apache-2.0
index 3b78c57..7411569 100755 (executable)
@@ -105,6 +105,15 @@ int ms_usb_insert_handler(const char *mount_path, const char *mount_uuid)
                        if (ms_set_storage_scan_status(handle, uuid, MEDIA_SCAN_PREPARE, uid) != MS_MEDIA_ERR_NONE) {
                                MS_DBG_ERR("ms_set_storage_scan_status failed");
                        }
+
+                       MS_DBG_ERR("init storage data in DB");
+                       /* update storage_id table set validity=0 first */
+                       ms_validaty_change_all_items(handle, mount_uuid, MS_STORAGE_EXTERNAL, false, uid);
+                       /*update folder table set validity = 0*/
+                       ms_set_folder_validity(handle, mount_uuid, storage_path, MS_INVALID, TRUE, uid);
+                       /* update folder table set scan_status=0 first */
+                       ms_set_folder_scan_status(handle, mount_uuid, NULL, MS_DIR_SCAN_NONE, uid);
+                       MS_DBG_ERR("init storage data in DB end");
                } else {
                        /* there is no information of this storage in Media DB */
                        ret = ms_insert_storage(handle, mount_uuid, NULL, mount_path, uid);