static int __media_info_get_media_info_from_db(char *path, media_info_h media)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
sqlite3_stmt *stmt = NULL;
char *select_query = NULL;
media_info_s *_media = (media_info_s*)media;
static int __media_info_get_media_path_by_id_from_db(const char *media_id, char **path)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
sqlite3_stmt *stmt = NULL;
char *select_query = NULL;
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
_media->latitude = (double)sqlite3_column_double(stmt, 22);
_media->altitude = (double)sqlite3_column_double(stmt, 23);
+ if(STRING_VALID((const char *)sqlite3_column_text(stmt, 28)))
+ _media->title = strdup((const char *)sqlite3_column_text(stmt, 28));
+
if(_media->media_type == MEDIA_CONTENT_TYPE_IMAGE) {
_media->image_meta = (image_meta_s *)calloc(1, sizeof(image_meta_s));
if(_media->image_meta) {
_media->image_meta->orientation = sqlite3_column_int(stmt, 27);
+ if(STRING_VALID((const char *)sqlite3_column_text(stmt, 28)))
+ _media->image_meta->title = strdup((const char *)sqlite3_column_text(stmt, 28));
+
if(STRING_VALID((const char *)sqlite3_column_text(stmt, 44)))
_media->image_meta->burst_id = strdup((const char *)sqlite3_column_text(stmt, 44));
}
}
media_content_debug("media_svc_insert_item_immediately: %s", _path);
- ret = media_svc_insert_item_immediately(_content_get_db_handle(), storage_type, _path);
+ ret = media_svc_insert_item_immediately(_content_get_db_handle(), storage_type, _path, tzplatform_getuid(TZ_USER_NAME));
if (ret < 0) {
media_content_error("media_svc_insert_item_immediately failed : %d (%s)", ret, _path);
_cb_data->insert_list_path = strdup(list_path);
if(insert_type == MEDIA_BATCH_INSERT_NORMAL)
- ret = media_files_register(list_path, __media_info_insert_completed_cb, _cb_data);
+ ret = media_files_register(list_path, __media_info_insert_completed_cb, _cb_data, tzplatform_getuid(TZ_USER_NAME));
else if(insert_type == MEDIA_BATCH_INSERT_BURSTSHOT)
- ret = media_burstshot_register(list_path, __media_info_insert_completed_cb, _cb_data);
+ ret = media_burstshot_register(list_path, __media_info_insert_completed_cb, _cb_data, tzplatform_getuid(TZ_USER_NAME));
else
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
return ret;
}
- ret = media_svc_delete_item_by_path(_content_get_db_handle(), path);
+ ret = media_svc_delete_item_by_path(_content_get_db_handle(), path, tzplatform_getuid(TZ_USER_NAME));
SAFE_FREE(path);
return _content_error_capi(ret,MEDIA_CONTENT_TYPE);
SAFE_FREE(_media->location_tag);
SAFE_FREE(_media->age_rating);
SAFE_FREE(_media->keyword);
+ SAFE_FREE(_media->title);
if(_media->image_meta) {
SAFE_FREE(_media->image_meta->media_id);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
+ if(STRING_VALID(_src->title))
+ {
+ _dst->title = strdup(_src->title);
+ if(_dst->title == NULL)
+ {
+ media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+ media_info_destroy((media_info_h)_dst);
+ return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+ }
+ }
if(STRING_VALID(_src->author))
{
_dst->author = strdup(_src->author);
_image->date_taken = strdup(_media->image_meta->date_taken);
}
+ if(STRING_VALID(_media->image_meta->title)) {
+ _image->title = strdup(_media->image_meta->title);
+ }
+
if(STRING_VALID(_media->image_meta->burst_id)) {
_image->burst_id = strdup(_media->image_meta->burst_id);
}
return ret;
}
+int media_info_get_title(media_info_h media, char **title)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ media_info_s *_media = (media_info_s*)media;
+
+ if(_media && title)
+ {
+ if(STRING_VALID(_media->title))
+ {
+ *title = strdup(_media->title);
+ if(*title == NULL)
+ {
+ media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+ return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+ }
+ }
+ else
+ {
+ *title = NULL;
+ }
+ ret = MEDIA_CONTENT_ERROR_NONE;
+ }
+ else
+ {
+ media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+ ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+
+ return ret;
+}
+
int media_info_get_description(media_info_h media, char **description)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
int media_info_get_media_from_db(const char *media_id, media_info_h *media)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
char select_query[DEFAULT_QUERY_SIZE];
sqlite3_stmt *stmt = NULL;
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
return ret;
}
- ret = media_svc_refresh_item(_content_get_db_handle(), storage_type, file_path);
+ ret = media_svc_refresh_item(_content_get_db_handle(), storage_type, file_path, tzplatform_getuid(TZ_USER_NAME));
SAFE_FREE(file_path);
media_info_destroy(media);
ret = _media_util_get_store_type_by_path(dst_path, &dst_storage_type);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
- ret = media_svc_move_item(_content_get_db_handle(), src_storage_type, _media->file_path, dst_storage_type, dst_path);
+ ret = media_svc_move_item(_content_get_db_handle(), src_storage_type, _media->file_path, dst_storage_type, dst_path, tzplatform_getuid(TZ_USER_NAME));
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
}
_thumb_cb->user_data = user_data;
_thumb_cb->thumbnail_completed_cb = callback;
- ret = thumbnail_request_from_db_async(_media->file_path, (ThumbFunc)__media_info_thumbnail_completed_cb, (void *)_thumb_cb);
+ ret = thumbnail_request_from_db_async(_media->file_path, (ThumbFunc)__media_info_thumbnail_completed_cb, (void *)_thumb_cb, tzplatform_getuid(TZ_USER_NAME));
ret = _content_error_capi(MEDIA_THUMBNAIL_TYPE, ret);
}
else
if(_media != NULL && STRING_VALID(_media->media_id) && STRING_VALID(_media->file_path))
{
- ret = thumbnail_request_cancel_media(_media->file_path);
+ ret = thumbnail_request_cancel_media(_media->file_path, tzplatform_getuid(TZ_USER_NAME));
ret = _content_error_capi(MEDIA_THUMBNAIL_TYPE, ret);
}
else