Add parameter for update metadata 82/58582/1 accepted/tizen/mobile/20160203.052718 accepted/tizen/tv/20160203.052746 accepted/tizen/wearable/20160203.052821 submit/tizen/20160203.025327
authorMinje Ahn <minje.ahn@samsung.com>
Tue, 2 Feb 2016 05:43:47 +0000 (14:43 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Tue, 2 Feb 2016 05:43:47 +0000 (14:43 +0900)
Change-Id: I71c318c3a7eb2762db51de12a57b20c1fef550ff
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
include/media-svc.h
plugin/media-content-plugin.c
src/common/media-svc.c

index bf31747..14f1f73 100755 (executable)
@@ -69,7 +69,7 @@ int media_svc_get_pinyin(const char *src_str, char **pinyin_str);
 int media_svc_check_pinyin_support(bool *support);
 int media_svc_update_item_begin(int data_cnt);
 int media_svc_update_item_end(uid_t uid);
-int media_svc_update_item_meta(MediaSvcHandle *handle, const char *file_path, int storage_type, uid_t uid);
+int media_svc_update_item_meta(MediaSvcHandle *handle, const char *file_path, const char *storage_id, int storage_type, uid_t uid);
 int media_svc_insert_item_immediately_with_data(MediaSvcHandle *handle, media_svc_content_info_s *content_info, uid_t uid);
 void media_svc_destroy_content_info(media_svc_content_info_s *content_info);
 
index 4d31135..33446e8 100755 (executable)
@@ -841,7 +841,7 @@ int update_item_end(void *handle, uid_t uid, char **err_msg)
        return MEDIA_SVC_PLUGIN_ERROR_NONE;
 }
 
-int update_item_meta(void *handle, const char *file_path, int storage_type, uid_t uid, char **err_msg)
+int update_item_meta(void *handle, const char *file_path, const char *storage_id, int storage_type, uid_t uid, char **err_msg)
 {
        int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
 
@@ -855,7 +855,12 @@ int update_item_meta(void *handle, const char *file_path, int storage_type, uid_
                return MEDIA_SVC_PLUGIN_ERROR;
        }
 
-       ret = media_svc_update_item_meta(handle, file_path, storage_type, uid);
+       if (storage_id == NULL) {
+               __set_error_message(ERR_HANDLE, err_msg);
+               return MEDIA_SVC_PLUGIN_ERROR;
+       }
+
+       ret = media_svc_update_item_meta(handle, file_path, storage_id, storage_type, uid);
        if (ret < 0) {
                __set_error_message(ret, err_msg);
                return MEDIA_SVC_PLUGIN_ERROR;
index e6a1ee6..0b29fac 100755 (executable)
@@ -1306,7 +1306,7 @@ int media_svc_update_item_end(uid_t uid)
        return ret;
 }
 
-int media_svc_update_item_meta(MediaSvcHandle *handle, const char *file_path, int storage_type, uid_t uid)
+int media_svc_update_item_meta(MediaSvcHandle *handle, const char *file_path, const char *storage_id, int storage_type, uid_t uid)
 {
        int ret = MS_MEDIA_ERR_NONE;
        sqlite3 *db_handle = (sqlite3 *)handle;
@@ -1321,7 +1321,7 @@ int media_svc_update_item_meta(MediaSvcHandle *handle, const char *file_path, in
        memset(&content_info, 0, sizeof(media_svc_content_info_s));
 
        /*Set media info*/
-       ret = _media_svc_set_media_info(&content_info, DEFAULT_MEDIA_SVC_STORAGE_ID, storage_type, file_path, &media_type, FALSE);
+       ret = _media_svc_set_media_info(&content_info, storage_id, storage_type, file_path, &media_type, FALSE);
        if (ret != MS_MEDIA_ERR_NONE) {
                return ret;
        }