{
int ret = MS_MEDIA_ERR_NONE;
char *burst_id = NULL;
- int ini_val = _media_svc_get_ini_value();
const char *db_fields = "media_uuid, path, file_name, media_type, mime_type, size, added_time, modified_time, folder_uuid, \
thumbnail_path, title, album_id, album, artist, album_artist, genre, composer, year, recorded_date, copyright, track_num, description, \
}
/* Get thumbnail for burst shot */
- if (ini_val == 1) {
- char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1] = {0, };
- int width = 0;
- int height = 0;
-
- ret = _media_svc_request_thumbnail_with_origin_size(content_info->path, thumb_path, sizeof(thumb_path), &width, &height, uid);
- if (ret == MS_MEDIA_ERR_NONE) {
- ret = __media_svc_malloc_and_strncpy(&(content_info->thumbnail_path), thumb_path);
- if (ret != MS_MEDIA_ERR_NONE)
- content_info->thumbnail_path = NULL;
- }
-
- if (content_info->media_meta.width <= 0)
- content_info->media_meta.width = width;
+ char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1] = {0, };
+ int width = 0;
+ int height = 0;
- if (content_info->media_meta.height <= 0)
- content_info->media_meta.height = height;
+ ret = _media_svc_request_thumbnail_with_origin_size(content_info->path, thumb_path, sizeof(thumb_path), &width, &height, uid);
+ if (ret == MS_MEDIA_ERR_NONE) {
+ ret = __media_svc_malloc_and_strncpy(&(content_info->thumbnail_path), thumb_path);
+ if (ret != MS_MEDIA_ERR_NONE)
+ content_info->thumbnail_path = NULL;
}
+
+ if (content_info->media_meta.width <= 0)
+ content_info->media_meta.width = width;
+
+ if (content_info->media_meta.height <= 0)
+ content_info->media_meta.height = height;
}
/*Update Pinyin If Support Pinyin*/
sqlite3 *db_handle = (sqlite3 *)handle;
char folder_uuid[MEDIA_SVC_UUID_SIZE + 1] = {0, };
media_svc_media_type_e media_type;
- int ini_val = _media_svc_get_ini_value();
media_svc_retvm_if(db_handle == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "Handle is NULL");
media_svc_retvm_if(!STRING_VALID(storage_id), MS_MEDIA_ERR_INVALID_PARAMETER, "storage_id is NULL");
ret = __media_svc_malloc_and_strncpy(&content_info.folder_uuid, folder_uuid);
media_svc_retv_del_if(ret != MS_MEDIA_ERR_NONE, ret, &content_info);
-#if 1
+
/* Extracting thumbnail */
- if (ini_val == 1) {
- if (content_info.thumbnail_path == NULL) {
- if (media_type == MEDIA_SVC_MEDIA_TYPE_IMAGE || media_type == MEDIA_SVC_MEDIA_TYPE_VIDEO) {
- char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1] = {0, };
- int width = 0;
- int height = 0;
+ if (content_info.thumbnail_path == NULL) {
+ if (media_type == MEDIA_SVC_MEDIA_TYPE_IMAGE || media_type == MEDIA_SVC_MEDIA_TYPE_VIDEO) {
+ char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1] = {0, };
+ int width = 0;
+ int height = 0;
- ret = _media_svc_request_thumbnail_with_origin_size(content_info.path, thumb_path, sizeof(thumb_path), &width, &height, uid);
- if (ret == MS_MEDIA_ERR_NONE)
- ret = __media_svc_malloc_and_strncpy(&(content_info.thumbnail_path), thumb_path);
+ ret = _media_svc_request_thumbnail_with_origin_size(content_info.path, thumb_path, sizeof(thumb_path), &width, &height, uid);
+ if (ret == MS_MEDIA_ERR_NONE)
+ ret = __media_svc_malloc_and_strncpy(&(content_info.thumbnail_path), thumb_path);
- if (content_info.media_meta.width <= 0)
- content_info.media_meta.width = width;
+ if (content_info.media_meta.width <= 0)
+ content_info.media_meta.width = width;
- if (content_info.media_meta.height <= 0)
- content_info.media_meta.height = height;
- }
+ if (content_info.media_meta.height <= 0)
+ content_info.media_meta.height = height;
}
}
-#endif
ret = _media_svc_insert_item_with_data(db_handle, storage_id, &content_info, FALSE, FALSE, uid);
int ret = MS_MEDIA_ERR_NONE;
sqlite3 *db_handle = (sqlite3 *)handle;
media_svc_media_type_e media_type;
- int ini_val = _media_svc_get_ini_value();
media_svc_retvm_if(db_handle == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "Handle is NULL");
media_svc_retvm_if(!STRING_VALID(storage_id), MS_MEDIA_ERR_INVALID_PARAMETER, "storage_id is NULL");
return ret;
/* Initialize thumbnail information to remake thumbnail. */
- if (ini_val == 1) {
- char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1];
- ret = _media_svc_get_thumbnail_path_by_path(db_handle, storage_id, path, thumb_path);
- if (ret != MS_MEDIA_ERR_NONE) {
- _media_svc_destroy_content_info(&content_info);
- return ret;
- }
+ char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1];
+ ret = _media_svc_get_thumbnail_path_by_path(db_handle, storage_id, path, thumb_path);
+ if (ret != MS_MEDIA_ERR_NONE) {
+ _media_svc_destroy_content_info(&content_info);
+ return ret;
+ }
- if (g_file_test(thumb_path, G_FILE_TEST_EXISTS) && (STRING_VALID(MEDIA_SVC_THUMB_DEFAULT_PATH)) && (strncmp(thumb_path, MEDIA_SVC_THUMB_DEFAULT_PATH, strlen(MEDIA_SVC_THUMB_DEFAULT_PATH)) != 0)) {
- ret = _media_svc_remove_file(thumb_path);
- if (ret != MS_MEDIA_ERR_NONE)
- media_svc_error("_media_svc_remove_file failed : %s", thumb_path);
- }
+ if (g_file_test(thumb_path, G_FILE_TEST_EXISTS) && (STRING_VALID(MEDIA_SVC_THUMB_DEFAULT_PATH)) && (strncmp(thumb_path, MEDIA_SVC_THUMB_DEFAULT_PATH, strlen(MEDIA_SVC_THUMB_DEFAULT_PATH)) != 0)) {
+ ret = _media_svc_remove_file(thumb_path);
+ if (ret != MS_MEDIA_ERR_NONE)
+ media_svc_error("_media_svc_remove_file failed : %s", thumb_path);
+ }
- ret = _media_svc_update_thumbnail_path(storage_id, path, NULL, uid);
- if (ret != MS_MEDIA_ERR_NONE) {
- _media_svc_destroy_content_info(&content_info);
- return ret;
- }
+ ret = _media_svc_update_thumbnail_path(storage_id, path, NULL, uid);
+ if (ret != MS_MEDIA_ERR_NONE) {
+ _media_svc_destroy_content_info(&content_info);
+ return ret;
}
/* Get notification info */
_media_svc_destroy_content_info(&content_info);
return ret;
}
-#if 1
+
/* Extracting thumbnail */
- if (ini_val == 1) {
- if (content_info.thumbnail_path == NULL) {
- if (media_type == MEDIA_SVC_MEDIA_TYPE_IMAGE || media_type == MEDIA_SVC_MEDIA_TYPE_VIDEO) {
- char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1] = {0, };
- int width = 0;
- int height = 0;
+ if (content_info.thumbnail_path == NULL) {
+ if (media_type == MEDIA_SVC_MEDIA_TYPE_IMAGE || media_type == MEDIA_SVC_MEDIA_TYPE_VIDEO) {
+ char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1] = {0, };
+ int width = 0;
+ int height = 0;
- ret = _media_svc_request_thumbnail_with_origin_size(content_info.path, thumb_path, sizeof(thumb_path), &width, &height, uid);
- if (ret == MS_MEDIA_ERR_NONE)
- ret = __media_svc_malloc_and_strncpy(&(content_info.thumbnail_path), thumb_path);
+ ret = _media_svc_request_thumbnail_with_origin_size(content_info.path, thumb_path, sizeof(thumb_path), &width, &height, uid);
+ if (ret == MS_MEDIA_ERR_NONE)
+ ret = __media_svc_malloc_and_strncpy(&(content_info.thumbnail_path), thumb_path);
- if (content_info.media_meta.width <= 0)
- content_info.media_meta.width = width;
+ if (content_info.media_meta.width <= 0)
+ content_info.media_meta.width = width;
- if (content_info.media_meta.height <= 0)
- content_info.media_meta.height = height;
- }
+ if (content_info.media_meta.height <= 0)
+ content_info.media_meta.height = height;
}
}
-#endif
-
ret = _media_svc_update_item_with_data(storage_id, &content_info, uid);
if (ret == MS_MEDIA_ERR_NONE) {
media_svc_retv_del_if(ret != MS_MEDIA_ERR_NONE, ret, content_info);
/* Extracting thumbnail */
- int ini_val = _media_svc_get_ini_value();
- if (ini_val == 1) {
- if (_new_content_info.thumbnail_path == NULL) {
- if (media_type == MEDIA_SVC_MEDIA_TYPE_IMAGE || media_type == MEDIA_SVC_MEDIA_TYPE_VIDEO) {
- char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1] = {0, };
- int width = 0;
- int height = 0;
-
- ret = _media_svc_request_thumbnail_with_origin_size(_new_content_info.path, thumb_path, sizeof(thumb_path), &width, &height, uid);
- if (ret == MS_MEDIA_ERR_NONE)
- ret = __media_svc_malloc_and_strncpy(&(_new_content_info.thumbnail_path), thumb_path);
-
- if (_new_content_info.media_meta.width <= 0)
- _new_content_info.media_meta.width = width;
-
- if (_new_content_info.media_meta.height <= 0)
- _new_content_info.media_meta.height = height;
- }
+ if (_new_content_info.thumbnail_path == NULL) {
+ if (media_type == MEDIA_SVC_MEDIA_TYPE_IMAGE || media_type == MEDIA_SVC_MEDIA_TYPE_VIDEO) {
+ char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1] = {0, };
+ int width = 0;
+ int height = 0;
+
+ ret = _media_svc_request_thumbnail_with_origin_size(_new_content_info.path, thumb_path, sizeof(thumb_path), &width, &height, uid);
+ if (ret == MS_MEDIA_ERR_NONE)
+ ret = __media_svc_malloc_and_strncpy(&(_new_content_info.thumbnail_path), thumb_path);
+
+ if (_new_content_info.media_meta.width <= 0)
+ _new_content_info.media_meta.width = width;
+
+ if (_new_content_info.media_meta.height <= 0)
+ _new_content_info.media_meta.height = height;
}
}
}