Modify thumbnail store path 13/184313/1 accepted/tizen/unified/20180730.141946 submit/tizen/20180727.060045
authorMinje Ahn <minje.ahn@samsung.com>
Tue, 17 Jul 2018 07:09:29 +0000 (16:09 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Tue, 17 Jul 2018 07:09:29 +0000 (16:09 +0900)
Unifies the thumbnail path regardless of the storage type

Change-Id: I5fddd6dda0db18cab0113a46f5fe3922cd960333
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
30_media-server-add.post
lib/include/media-util-user.h
lib/media-util-user.c
packaging/media-server.spec

index 37dc8c1..ffb0e4f 100644 (file)
@@ -12,8 +12,7 @@ then
 /usr/bin/chmod 0644 $TZ_USER_DB/.media.db
 /usr/bin/chsmack -a 'User::Home' $TZ_USER_DB/.media.db
 
-/usr/bin/mkdir -p $TZ_USER_SHARE/media/.thumb/phone
-/usr/bin/mkdir -p $TZ_USER_SHARE/media/.thumb/mmc
+/usr/bin/mkdir -p $TZ_USER_SHARE/media/.thumb
 /usr/bin/chown -R multimedia_fw:multimedia_fw $TZ_USER_SHARE/media
 /usr/bin/chsmack -a 'User::App::Shared' -t $TZ_USER_SHARE/media
 /usr/bin/chmod 0775 $TZ_USER_SHARE/media
index b3950cd..cbb36af 100755 (executable)
@@ -35,7 +35,6 @@ typedef enum {
 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_thumb_store_path(uid_t uid, ms_user_storage_type_e storage_type, const char *storage_id, char **path);
 int ms_user_get_media_db_path(uid_t uid, char **path);
 
 #ifndef _USE_TVPD_MODE
index 174dae4..0a9f053 100755 (executable)
@@ -35,8 +35,6 @@ typedef enum {
        MEDIA_DB = 0,
        INTERNAL_ROOT,
        THUMB_ROOT,
-       THUMB_INTERNAL,
-       THUMB_EXTERNAL,
        MEDIA_SHARED
 } ms_user_path_type_e;
 
@@ -65,7 +63,6 @@ static int __ms_user_get_path(ms_user_path_type_e type, const char *storage_id,
 
        idx = uid - 5000;
        MSAPI_RETVM_IF(idx < 0 || idx > 127, MS_MEDIA_ERR_INVALID_PARAMETER, "Invalid uid");
-       MSAPI_RETVM_IF(type == THUMB_EXTERNAL && storage_id == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "storage_id is NULL");
 
        g_mutex_lock(&tzplatform_mutex);
 
@@ -93,12 +90,6 @@ static int __ms_user_get_path(ms_user_path_type_e type, const char *storage_id,
        case THUMB_ROOT:
                result = tzplatform_context_mkpath(context[idx], TZ_USER_SHARE, "media/.thumb");
                break;
-       case THUMB_INTERNAL:
-               result = tzplatform_context_mkpath(context[idx], TZ_USER_SHARE, "media/.thumb/phone");
-               break;
-       case THUMB_EXTERNAL:
-               result = tzplatform_context_mkpath3(context[idx], TZ_USER_SHARE, "media/.thumb/mmc", storage_id);
-               break;
 #ifndef _USE_TVPD_MODE
        case MEDIA_SHARED:
                result = tzplatform_context_getenv(context[idx], TZ_USER_MEDIASHARED);
@@ -191,37 +182,6 @@ int ms_user_get_root_thumb_store_path(uid_t uid, char **path)
        return ret;
 }
 
-int ms_user_get_thumb_store_path(uid_t uid, ms_user_storage_type_e storage_type, const char *storage_id, char **path)
-{
-       int ret = MS_MEDIA_ERR_NONE;
-
-       if (uid == getuid()) {
-               if (storage_type == MS_USER_STORAGE_INTERNAL)
-                       *path = g_strdup(tzplatform_mkpath(TZ_USER_SHARE, "media/.thumb/phone"));
-               else
-                       *path = g_strdup(tzplatform_mkpath3(TZ_USER_SHARE, "media/.thumb/mmc", storage_id));
-       } else {
-               if (storage_type == MS_USER_STORAGE_INTERNAL)
-                       ret = __ms_user_get_path(THUMB_INTERNAL, NULL, uid, path);
-               else
-                       ret = __ms_user_get_path(THUMB_EXTERNAL, storage_id, uid, path);
-       }
-
-       //MSAPI_DBG_SLOG("thumb path [%s]", *path);
-       /* Create if not exist */
-       if (storage_type == MS_USER_STORAGE_EXTERNAL) {
-               if (!g_file_test(*path, G_FILE_TEST_EXISTS)) {
-                       ret = g_mkdir_with_parents(*path, S_IRWXU | S_IRWXG | S_IRWXO);
-                       if (ret != 0) {
-                               MSAPI_DBG_ERR("Failed to create thumb directory for external");
-                               ret = MS_MEDIA_ERR_INTERNAL;
-                       }
-               }
-       }
-
-       return ret;
-}
-
 int ms_user_get_media_db_path(uid_t uid, char **path)
 {
        int ret = MS_MEDIA_ERR_NONE;
index 583e12a..e40d341 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       media-server
 Summary:    A server for media content management
-Version:    0.3.68
+Version:    0.3.69
 Release:    0
 Group:      Multimedia/Service
 License:    Apache-2.0