From: Minje Ahn Date: Thu, 17 Mar 2022 02:16:54 +0000 (+0900) Subject: Add book search DB path to user path list X-Git-Tag: accepted/tizen/unified/20220323.133741~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89403b15718ebf3c48dcd634d977bb293d2e2f2c;p=platform%2Fcore%2Fmultimedia%2Fmedia-server.git Add book search DB path to user path list Change-Id: I624cf94f9d3b94300386368f87a2f5acc7218dce Signed-off-by: Minje Ahn --- diff --git a/lib/include/media-util-user.h b/lib/include/media-util-user.h index cbb36af..e7ef133 100755 --- a/lib/include/media-util-user.h +++ b/lib/include/media-util-user.h @@ -36,6 +36,7 @@ int ms_user_get_internal_root_path(uid_t uid, char **path); int ms_user_get_storage_type(uid_t uid, const char *path, ms_user_storage_type_e *storage_type); int ms_user_get_root_thumb_store_path(uid_t uid, char **path); int ms_user_get_media_db_path(uid_t uid, char **path); +int ms_user_get_wordbook_db_path(uid_t uid, char **path); #ifndef _USE_TVPD_MODE int ms_user_get_mediashared_path(uid_t uid, char **path); diff --git a/lib/media-util-user.c b/lib/media-util-user.c index 682dd57..dc6342d 100755 --- a/lib/media-util-user.c +++ b/lib/media-util-user.c @@ -31,6 +31,7 @@ typedef enum { MEDIA_DB = 0, INTERNAL_ROOT, THUMB_ROOT, + WORDBOOK_DB, MEDIA_SHARED } ms_user_path_type_e; @@ -71,6 +72,9 @@ static int __ms_user_get_path(ms_user_path_type_e type, uid_t uid, char **path) case THUMB_ROOT: result = tzplatform_context_mkpath(context[idx], TZ_USER_SHARE, "media/.thumb"); break; + case WORDBOOK_DB: + result = tzplatform_context_mkpath(context[idx], TZ_USER_SHARE, "media/.ebook/.wordbook.db"); + break; #ifndef _USE_TVPD_MODE case MEDIA_SHARED: result = tzplatform_context_getenv(context[idx], TZ_USER_MEDIASHARED); @@ -171,6 +175,20 @@ int ms_user_get_media_db_path(uid_t uid, char **path) return ret; } +int ms_user_get_wordbook_db_path(uid_t uid, char **path) +{ + int ret = MS_MEDIA_ERR_NONE; + + if (uid == getuid()) + *path = g_strdup(tzplatform_mkpath(TZ_USER_SHARE, "media/.ebook/.wordbook.db")); + else + ret = __ms_user_get_path(WORDBOOK_DB, uid, path); + + //MSAPI_DBG_SLOG("DB path [%s]", *path); + + return ret; +} + #ifndef _USE_TVPD_MODE int ms_user_get_mediashared_path(uid_t uid, char **path) {