Remove storage_name column 68/178668/3
authorMinje Ahn <minje.ahn@samsung.com>
Fri, 11 May 2018 07:07:14 +0000 (16:07 +0900)
committerhj kim <backto.kim@samsung.com>
Mon, 14 May 2018 04:44:17 +0000 (04:44 +0000)
1. Remove storage name column from DB
2. Remove parameter related with storage name from functions

Change-Id: Ib977f154cd3089687ba974ab0fdb788771b08919
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
packaging/media-server.spec
src/common/include/media-common-db-svc.h
src/common/media-common-db-svc.c
src/mediadb-update.c
src/server/media-server-device-block.c
src/server/media-server-main.c
src/server/media-server-socket.c

index 3d1711f..485eac6 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       media-server
 Summary:    A server for media content management
-Version:    0.3.66
+Version:    0.3.67
 Release:    0
 Group:      Multimedia/Service
 License:    Apache-2.0
index 1e7f0ef..b6b1fc1 100755 (executable)
@@ -89,7 +89,7 @@ typedef int (*CHANGE_VALIDITY_ITEM_BATCH)(void *, const char *, const char *, in
 typedef int (*CHECK_DB)(void*, uid_t, char **);
 typedef int (*GET_UUID)(void *, char **, char **);
 typedef int (*CHECK_STORAGE)(void *, const char *, char **, int *, uid_t, char **);
-typedef int (*INSERT_STORAGE)(void *, const char *, int, const char *, const char *, uid_t, char **);
+typedef int (*INSERT_STORAGE)(void *, const char *, int, const char *, uid_t, char **);
 typedef int (*UPDATE_STORAGE)(void *, const char *, const char *, uid_t, char **);
 typedef int (*SET_STORAGE_VALIDITY)(void *, const char *, int, uid_t uid, char **);
 typedef int (*SET_ALL_STORAGE_VALIDITY)(void *, int, uid_t, char **);
@@ -137,7 +137,7 @@ int ms_change_validity_item_batch(void **handle, const char *storage_id, const c
 int ms_check_db_upgrade(void **handle, uid_t uid);
 int ms_genarate_uuid(void **handle, char **uuid);
 int ms_check_storage(void **handle, const char *storage_id, char **storage_path, int *validity, uid_t uid);
-int ms_insert_storage(void **handle, const char *storage_id, const char *storage_name, const char *storage_path, uid_t uid);
+int ms_insert_storage(void **handle, const char *storage_id, const char *storage_path, uid_t uid);
 int ms_update_storage(void **handle, const char *storage_id, const char *storage_path, uid_t uid);
 int ms_set_storage_validity(void **handle, const char *storage_id, int validity, uid_t uid);
 int ms_set_all_storage_validity(void **handle, int validity, uid_t uid);
index 1940b74..b721b95 100755 (executable)
@@ -936,7 +936,7 @@ int ms_check_storage(void **handle, const char *storage_id, char **storage_path,
        return res;
 }
 
-int ms_insert_storage(void **handle, const char *storage_id, const char *storage_name, const char *storage_path, uid_t uid)
+int ms_insert_storage(void **handle, const char *storage_id, const char *storage_path, uid_t uid)
 {
        int lib_index = 0;
        int res = MS_MEDIA_ERR_NONE;
@@ -950,7 +950,7 @@ int ms_insert_storage(void **handle, const char *storage_id, const char *storage
        MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "Fail to get storage type");
 
        for (lib_index = 0; lib_index < lib_num; lib_index++) {
-               ret = ((INSERT_STORAGE)func_array[lib_index][eINSERT_STORAGE])(handle[lib_index], storage_id, storage_type, storage_name, storage_path, uid, &err_msg);
+               ret = ((INSERT_STORAGE)func_array[lib_index][eINSERT_STORAGE])(handle[lib_index], storage_id, storage_type, storage_path, uid, &err_msg);
                if (ret != 0) {
                        MS_DBG_ERR("error : %s [%s]", g_array_index(so_array, char*, lib_index), err_msg);
                        MS_SAFE_FREE(err_msg);
index ccfa1a0..49685d7 100755 (executable)
@@ -59,7 +59,7 @@ int (*svc_connect)                            (void ** handle, uid_t uid, char ** err_msg);
 int (*svc_disconnect)                  (void * handle, char ** err_msg);
 int (*svc_check_db)                    (void * handle, uid_t uid, char ** err_msg);
 int (*svc_get_storage_id)              (void * handle, const char *path, char *storage_id, uid_t uid, char ** err_msg);
-int (*svc_insert_storage)              (void *handle, const char *storage_id, int storage_type, const char *storage_name, const char *storage_path, uid_t uid, char **err_msg);
+int (*svc_insert_storage)              (void *handle, const char *storage_id, int storage_type, const char *storage_path, uid_t uid, char **err_msg);
 int (*svc_update_storage)              (void *handle, const char *storage_id, const char *storage_path, uid_t uid, char **err_msg);
 int (*svc_set_storage_validity)        (void * handle, const char *storage_id, int validity, uid_t uid, char **err_msg);
 int (*svc_check_storage)               (void * handle, const char *storage_id, char **storage_path, int *validity, uid_t uid, char **err_msg);
@@ -267,7 +267,7 @@ static bool __check_storage(void)
                                        }
                                } else {
                                        /* insert new storage */
-                                       ret = svc_insert_storage(db_handle, block_info->mount_uuid, 1, NULL, block_info->mount_path, tzplatform_getuid(TZ_USER_NAME), &err_msg);
+                                       ret = svc_insert_storage(db_handle, block_info->mount_uuid, 1, block_info->mount_path, tzplatform_getuid(TZ_USER_NAME), &err_msg);
                                        if (ret < 0)
                                                printf("Error svc_insert_storage\n");
 
index 4302002..7c0e2ab 100755 (executable)
@@ -113,7 +113,7 @@ int ms_storage_insert_handler(const char *mount_path, const char *mount_uuid)
                        MS_DBG_WARN("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);
+                       ret = ms_insert_storage(handle, mount_uuid, mount_path, uid);
                        if (ret != MS_MEDIA_ERR_NONE) {
                                MS_DBG_ERR("ms_insert_storage failed");
                                goto ERROR;
@@ -233,7 +233,7 @@ static void __ms_usb_add_event(const char *mount_path)
                                        MS_DBG_ERR("ms_set_storage_scan_status failed");
                        } else {
                                /* there is no information of this storage in Media DB */
-                               ret = ms_insert_storage(handle, storage_id, NULL, mount_path, uid);
+                               ret = ms_insert_storage(handle, storage_id, mount_path, uid);
                        }
                } else {
                        MS_DBG_ERR("STORAGE ID IS NUILL");
@@ -456,7 +456,7 @@ int ms_check_mounted_storage(uid_t uid)
                                        MS_SAFE_FREE(device_uuid);
                                        continue;
                                }
-                               ret = ms_insert_storage(handle, device_uuid, NULL, mounted_path, uid);
+                               ret = ms_insert_storage(handle, device_uuid, mounted_path, uid);
 
                                scan_type = MS_SCAN_ALL;
                                storage_id = strdup(device_uuid);
@@ -495,13 +495,13 @@ int ms_check_mounted_storage(uid_t uid)
                                        } else {
                                                /* there is no information of this storage in Media DB */
                                                MS_DBG_WARN("insert storage %s", mounted_path);
-                                               ret = ms_insert_storage(handle, storage_id, NULL, mounted_path, uid);
+                                               ret = ms_insert_storage(handle, storage_id, mounted_path, uid);
                                                scan_type = MS_SCAN_ALL;
                                        }
                                } else {
                                        /* there is no information of this storage in Media DB */
                                        MS_DBG_WARN("insert storage %s", mounted_path);
-                                       ret = ms_insert_storage(handle, storage_id, NULL, mounted_path, uid);
+                                       ret = ms_insert_storage(handle, storage_id, mounted_path, uid);
                                        scan_type = MS_SCAN_ALL;
                                }
                        }
index 600bad0..3659afc 100755 (executable)
@@ -212,7 +212,7 @@ void _ms_datadisc_vconf_cb(void *data)
                                MS_DBG_WARN("init storage data in DB end");
 
                        } else {
-                               ret = ms_insert_storage(handle, DATADISC_STORAGE_ID, NULL, mnt_path, uid);
+                               ret = ms_insert_storage(handle, DATADISC_STORAGE_ID, mnt_path, uid);
                                if (ret != MS_MEDIA_ERR_NONE) {
                                        MS_DBG_ERR("ms_insert_storage failed");
                                        goto END;
@@ -699,7 +699,7 @@ static int __ms_check_disc_status(void)
                                MS_DBG_WARN("init storage data in DB end");
 
                        } else {
-                               ret = ms_insert_storage(handle, DATADISC_STORAGE_ID, NULL, mnt_path, uid);
+                               ret = ms_insert_storage(handle, DATADISC_STORAGE_ID, mnt_path, uid);
                                if (ret != MS_MEDIA_ERR_NONE) {
                                        MS_DBG_ERR("ms_insert_storage failed");
                                        ms_unload_functions();
index 843dce7..345f430 100755 (executable)
@@ -551,14 +551,14 @@ int ms_send_storage_scan_request_senior_mode(void **handle)
                } else {
                        /* there is no information of this storage in Media DB */
                        MS_DBG_WARN("##[senior mode]insert storage %s", path);
-                       ret = ms_insert_storage(handle, storage_id, NULL, path, uid);
+                       ret = ms_insert_storage(handle, storage_id, path, uid);
                        MS_DBG_WARN("##[senior mode]");
                        scan_type = MS_SCAN_ALL;
                }
        } else {
                /* there is no information of this storage in Media DB */
                MS_DBG_WARN("##[senior mode]insert storage %s", path);
-               ret = ms_insert_storage(handle, storage_id, NULL, path, uid);
+               ret = ms_insert_storage(handle, storage_id, path, uid);
                MS_DBG_WARN("##[senior mode]");
                scan_type = MS_SCAN_ALL;
        }