summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinclude/media_info.h6
-rwxr-xr-xinclude_product/media_info.h6
-rwxr-xr-xpackaging/capi-content-media-content.spec2
-rwxr-xr-xsrc/media_info.c37
4 files changed, 11 insertions, 40 deletions
diff --git a/include/media_info.h b/include/media_info.h
index 6530b21..55b9eff 100755
--- a/include/media_info.h
+++ b/include/media_info.h
@@ -1581,8 +1581,9 @@ int media_info_set_added_time(media_info_h media, time_t added_time) TIZEN_DEPRE
* If you want to access only internal storage by using this function, you should add privilege http://tizen.org/privilege/mediastorage. \n
* Or if you want to access only external storage by using this function, you should add privilege http://tizen.org/privilege/externalstorage. \n
* If you can access both storage, you should add all privilege. \n
- * This function does not support USB storage. \n
- * Since 4.0, This function does not allow a symbolic link.
+ * Since 4.0, this function does not allow symbolic links. \n
+ * This function does not support USB storage before 5.0. Since 5.0, USB storage is supported. \n
+ * Since 5.0, the thumbnail is removed if it exists.
*
* @param[in] media The handle to the media info
* @param[in] dst_path The path of destination
@@ -1603,6 +1604,7 @@ int media_info_set_added_time(media_info_h media, time_t added_time) TIZEN_DEPRE
*
* @see media_content_connect()
* @see media_content_scan_folder()
+ * @see media_info_generate_thumbnail()
*/
int media_info_move_to_db(media_info_h media, const char* dst_path);
diff --git a/include_product/media_info.h b/include_product/media_info.h
index 6530b21..55b9eff 100755
--- a/include_product/media_info.h
+++ b/include_product/media_info.h
@@ -1581,8 +1581,9 @@ int media_info_set_added_time(media_info_h media, time_t added_time) TIZEN_DEPRE
* If you want to access only internal storage by using this function, you should add privilege http://tizen.org/privilege/mediastorage. \n
* Or if you want to access only external storage by using this function, you should add privilege http://tizen.org/privilege/externalstorage. \n
* If you can access both storage, you should add all privilege. \n
- * This function does not support USB storage. \n
- * Since 4.0, This function does not allow a symbolic link.
+ * Since 4.0, this function does not allow symbolic links. \n
+ * This function does not support USB storage before 5.0. Since 5.0, USB storage is supported. \n
+ * Since 5.0, the thumbnail is removed if it exists.
*
* @param[in] media The handle to the media info
* @param[in] dst_path The path of destination
@@ -1603,6 +1604,7 @@ int media_info_set_added_time(media_info_h media, time_t added_time) TIZEN_DEPRE
*
* @see media_content_connect()
* @see media_content_scan_folder()
+ * @see media_info_generate_thumbnail()
*/
int media_info_move_to_db(media_info_h media, const char* dst_path);
diff --git a/packaging/capi-content-media-content.spec b/packaging/capi-content-media-content.spec
index 57eec35..fc9349e 100755
--- a/packaging/capi-content-media-content.spec
+++ b/packaging/capi-content-media-content.spec
@@ -1,6 +1,6 @@
Name: capi-content-media-content
Summary: A Media content library in Tizen Native API
-Version: 0.3.32
+Version: 0.3.33
Release: 0
Group: Multimedia/API
License: Apache-2.0
diff --git a/src/media_info.c b/src/media_info.c
index bbe1f9f..5866729 100755
--- a/src/media_info.c
+++ b/src/media_info.c
@@ -3026,8 +3026,6 @@ int media_info_refresh_metadata_to_db(const char *media_id)
int media_info_move_to_db(media_info_h media, const char* dst_path)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- media_svc_storage_type_e src_storage_type = 0;
- media_svc_storage_type_e dst_storage_type = 0;
char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0, };
char repl_path[MAX_PATH_LEN] = {0, };
char org_repl_path[MAX_PATH_LEN] = {0, };
@@ -3050,23 +3048,6 @@ int media_info_move_to_db(media_info_h media, const char* dst_path)
ret = __media_info_check_file_validity(repl_path);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
- ret = media_svc_get_storage_type(org_repl_path, &src_storage_type, _content_get_uid());
- if (ret != MS_MEDIA_ERR_NONE) {
- media_content_sec_error("media_svc_get_storage_type failed : %d", ret);
- return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
- }
-
- ret = media_svc_get_storage_type(repl_path, &dst_storage_type, _content_get_uid());
- if (ret != MS_MEDIA_ERR_NONE) {
- media_content_sec_error("media_svc_get_storage_type failed : %d", ret);
- return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
- }
-
- if (src_storage_type == MEDIA_SVC_STORAGE_EXTERNAL_USB || dst_storage_type == MEDIA_SVC_STORAGE_EXTERNAL_USB) {
- media_content_sec_error("Unsupported storage type src[%d] dst[%d]", src_storage_type, dst_storage_type);
- return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
- }
-
memset(storage_id, 0x00, sizeof(storage_id));
ret = media_svc_get_storage_id(_content_get_db_handle(), org_repl_path, storage_id, _content_get_uid());
if (ret != MS_MEDIA_ERR_NONE) {
@@ -3074,21 +3055,7 @@ int media_info_move_to_db(media_info_h media, const char* dst_path)
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
}
- /*Delete the media info of the dest_path if it already exists.*/
- ret = media_svc_check_item_exist_by_path(_content_get_db_handle(), storage_id, repl_path);
- if (ret == MS_MEDIA_ERR_NONE) {
- /* Exists */
- ret = media_svc_delete_item_by_path(_content_get_db_handle(), storage_id, repl_path, _content_get_uid());
- if (ret != MS_MEDIA_ERR_NONE) {
- media_content_error("media_svc_delete_item_by_path failed : %d", ret);
- return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
- }
- } else if (ret != MS_MEDIA_ERR_NONE && ret != MS_MEDIA_ERR_DB_NO_RECORD) {
- media_content_error("media_svc_check_item_exist_by_path failed : %d", ret);
- return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
- }
-
- ret = media_svc_move_item(_content_get_db_handle(), storage_id, src_storage_type, org_repl_path, dst_storage_type, repl_path, _content_get_uid());
+ ret = media_svc_move_item(_content_get_db_handle(), org_repl_path, repl_path, _content_get_uid());
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
}
@@ -3140,7 +3107,7 @@ int media_info_generate_thumbnail(media_info_h media)
ret = _media_content_replace_path(_media->file_path, repl_path);
media_content_retvm_if(!STRING_VALID(repl_path), MEDIA_CONTENT_ERROR_INVALID_OPERATION, "path replacement failed");
- ret = media_svc_create_thumbnail(repl_path, _media->media_type, _content_get_uid(), &thumb_path);
+ ret = media_svc_create_thumbnail(_media->storage_uuid, repl_path, _media->media_type, _content_get_uid(), &thumb_path);
ret = _content_error_capi(MEDIA_THUMBNAIL_TYPE, ret);
if (ret == MEDIA_CONTENT_ERROR_UNSUPPORTED_CONTENT)
return ret;