From: Minje Ahn Date: Tue, 26 Sep 2017 06:48:14 +0000 (+0900) Subject: Fix playlist/tag bulk update X-Git-Tag: accepted/tizen/unified/20170929.081647~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F34%2F152434%2F1;p=platform%2Fcore%2Fmultimedia%2Flibmedia-service.git Fix playlist/tag bulk update Add counter initialization Change-Id: I19c1bb8222062bb65718e50e1226b7bf5be1b96d Signed-off-by: Minje Ahn --- diff --git a/src/common/media-svc-db-utils.c b/src/common/media-svc-db-utils.c index c8a536e..2940bc7 100755 --- a/src/common/media-svc-db-utils.c +++ b/src/common/media-svc-db-utils.c @@ -1393,7 +1393,7 @@ int _media_svc_sql_begin_trans(uid_t uid) { int ret = MS_MEDIA_ERR_NONE; - media_svc_error("========_media_svc_sql_begin_trans"); + media_svc_debug("Batch start(Transaction block version)"); ret = media_db_request_update_db_batch_start("BEGIN IMMEDIATE;", uid); @@ -1404,7 +1404,7 @@ int _media_svc_sql_end_trans(uid_t uid) { int ret = MS_MEDIA_ERR_NONE; - media_svc_error("========_media_svc_sql_end_trans"); + media_svc_debug("Batch end(Transaction block version)"); ret = media_db_request_update_db_batch_end("COMMIT;", uid); diff --git a/src/common/media-svc-media.c b/src/common/media-svc-media.c index da33170..c6f8840 100755 --- a/src/common/media-svc-media.c +++ b/src/common/media-svc-media.c @@ -668,16 +668,13 @@ int _media_svc_list_query_do(media_svc_query_type_e query_type, uid_t uid) else ret = MS_MEDIA_ERR_INVALID_PARAMETER; - if (ret != MS_MEDIA_ERR_NONE) { - media_svc_error("_media_svc_list_query_do failed. start rollback"); - return ret; - } + if (query_type == MEDIA_SVC_QUERY_UPDATE_COMMON) + g_media_svc_update_list_count = 0; + + media_svc_retvm_if(ret != MS_MEDIA_ERR_NONE, ret, "Failed to request queries"); ret = _media_svc_sql_end_trans(uid); - if (ret != MS_MEDIA_ERR_NONE) { - media_svc_error("mb_svc_sqlite3_commit_trans failed.. Now start to rollback"); - return ret; - } + media_svc_retvm_if(ret != MS_MEDIA_ERR_NONE, ret, "Failed to batch insert"); return MS_MEDIA_ERR_NONE; }