From: minje.ahn Date: Wed, 6 Mar 2024 06:17:19 +0000 (+0900) Subject: Use ms_user_get_root_length X-Git-Tag: accepted/tizen/unified/20240308.174235~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=f0baeacb7de890ac56dd98fbd89f4a7153513dbb;p=platform%2Fcore%2Fmultimedia%2Flibmedia-service.git Use ms_user_get_root_length Change-Id: I6c08d3849b54e911b62992b12280f44101bcabd2 Signed-off-by: minje.ahn --- diff --git a/src/common/media-svc-media-folder.c b/src/common/media-svc-media-folder.c index f1f3825..8f0903b 100755 --- a/src/common/media-svc-media-folder.c +++ b/src/common/media-svc-media-folder.c @@ -86,20 +86,9 @@ int _media_svc_update_folder_modified_time(const char *folder_path, uid_t uid) static int __media_svc_append_parent_folder(sqlite3 *handle, bool is_direct, const char *storage_id, const char *path, uid_t uid) { int ret = MS_MEDIA_ERR_NONE; - unsigned int next_pos = 0; + size_t next_pos = ms_user_get_root_length(path, uid); char *next = NULL; char *dir_path = NULL; - char *internal_path = NULL; - - if (g_str_has_prefix(path, tzplatform_getenv(TZ_SYS_STORAGE))) { - next_pos = strlen(tzplatform_getenv(TZ_SYS_STORAGE)) + 1; - } else { - ret = ms_user_get_internal_root_path(uid, &internal_path); - media_svc_retvm_if(ret != MS_MEDIA_ERR_NONE, ret, "Fail to get root path"); - - next_pos = strlen(internal_path); - g_free(internal_path); - } do { next = strstr(path + next_pos, "/");