- media_svc_debug("Transaction data count : [%d]", data_cnt);
-
- media_svc_retvm_if(data_cnt < 1, MS_MEDIA_ERR_INVALID_PARAMETER, "data_cnt shuld be bigger than 1");
-
- g_media_svc_update_item_data_cnt = data_cnt;
- g_media_svc_update_item_cur_data_cnt = 0;
-
- return MS_MEDIA_ERR_NONE;
-}
-
-int media_svc_update_item_end(uid_t uid)
-{
- int ret = MS_MEDIA_ERR_NONE;
-
- media_svc_debug_fenter();
-
- if (g_media_svc_update_item_cur_data_cnt > 0)
- ret = _media_svc_list_query_do(MEDIA_SVC_QUERY_UPDATE_ITEM, uid);
-
- g_media_svc_update_item_data_cnt = 1;
- g_media_svc_update_item_cur_data_cnt = 0;
-
- return ret;
-}
-
-int media_svc_update_item_meta(const char *file_path, const char *storage_id, int storage_type, uid_t uid)
-{
- int ret = MS_MEDIA_ERR_NONE;
- media_svc_media_type_e media_type;
- media_svc_content_info_s content_info;
- memset(&content_info, 0, sizeof(media_svc_content_info_s));
-
- /*Set media info*/
- 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;
-
- if (media_type == MEDIA_SVC_MEDIA_TYPE_MUSIC)
- ret = _media_svc_extract_music_metadata_for_update(&content_info, media_type);
- else {
- _media_svc_destroy_content_info(&content_info);
- return MS_MEDIA_ERR_NONE;
- }
-
- if (ret != MS_MEDIA_ERR_NONE) {
- _media_svc_destroy_content_info(&content_info);
- return ret;
- }
-
- if (g_media_svc_update_item_data_cnt == 1) {
-
- ret = _media_svc_update_meta_with_data(&content_info);
- media_svc_retv_del_if(ret != MS_MEDIA_ERR_NONE, ret, &content_info);
-
- } else if (g_media_svc_update_item_cur_data_cnt < (g_media_svc_update_item_data_cnt - 1)) {
-
- ret = _media_svc_update_meta_with_data(&content_info);
- media_svc_retv_del_if(ret != MS_MEDIA_ERR_NONE, ret, &content_info);
-
- g_media_svc_update_item_cur_data_cnt++;
-
- } else if (g_media_svc_update_item_cur_data_cnt == (g_media_svc_update_item_data_cnt - 1)) {
-
- ret = _media_svc_update_meta_with_data(&content_info);
- media_svc_retv_del_if(ret != MS_MEDIA_ERR_NONE, ret, &content_info);
-
- ret = _media_svc_list_query_do(MEDIA_SVC_QUERY_UPDATE_ITEM, uid);
- media_svc_retv_del_if(ret != MS_MEDIA_ERR_NONE, ret, &content_info);
-
- g_media_svc_update_item_cur_data_cnt = 0;
-
- } else {
- media_svc_error("Error in media_svc_update_item_meta");
- _media_svc_destroy_content_info(&content_info);
- return MS_MEDIA_ERR_INTERNAL;
- }
-
- _media_svc_destroy_content_info(&content_info);
-
- return ret;
-}
-
-int media_svc_publish_noti(media_item_type_e update_item, media_item_update_type_e update_type, const char *path, media_type_e media_type, const char *uuid, const char *mime_type)
-{
- return _media_svc_publish_noti(update_item, update_type, path, media_type, uuid, mime_type);
-}
-
-int media_svc_get_pinyin(const char *src_str, char **pinyin_str)
-{
- return _media_svc_get_pinyin_str(src_str, pinyin_str);
-}
-
-int media_svc_check_pinyin_support(bool *support)
-{
- *support = _media_svc_check_pinyin_support();
-
- return MS_MEDIA_ERR_NONE;
-}
-
-int media_svc_set_storage_validity(sqlite3 *handle, const char *storage_id, int validity, uid_t uid)
-{
- int ret = MS_MEDIA_ERR_NONE;
-
- media_svc_retvm_if(handle == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "Handle is NULL");
-
- ret = _media_svc_update_storage_validity(storage_id, validity, uid);
- media_svc_retvm_if(ret != MS_MEDIA_ERR_NONE, ret, "update storage validity failed: %d", ret);
-
- ret = _media_svc_update_media_view(handle, uid);
- media_svc_retvm_if(ret != MS_MEDIA_ERR_NONE, ret, "update media view failed : %d", ret);
-
- return ret;