Add book search DB path to user path list 46/272446/2
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 17 Mar 2022 02:16:54 +0000 (11:16 +0900)
committerMinje ahn <minje.ahn@samsung.com>
Tue, 22 Mar 2022 23:06:16 +0000 (23:06 +0000)
Change-Id: I624cf94f9d3b94300386368f87a2f5acc7218dce
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
lib/include/media-util-user.h
lib/media-util-user.c

index cbb36af..e7ef133 100755 (executable)
@@ -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);
index 682dd57..dc6342d 100755 (executable)
@@ -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)
 {