apply new path for the disc 85/98285/1 accepted/tizen/3.0/common/20161123.140643 accepted/tizen/3.0/ivi/20161123.083623 accepted/tizen/3.0/mobile/20161123.083306 accepted/tizen/3.0/tv/20161123.083442 accepted/tizen/3.0/wearable/20161123.083540 submit/tizen_3.0/20161122.043110
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 17 Nov 2016 02:36:57 +0000 (11:36 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Thu, 17 Nov 2016 02:36:57 +0000 (11:36 +0900)
Change-Id: Ia830963b41693d1474c930131d95847013d6b29c
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
packaging/libmedia-service.spec
src/common/media-svc-media-folder.c
src/common/media-svc-util.c

index 3c2bfd7..d5010a8 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmedia-service
 Summary:    Media information service library for multimedia applications
-Version: 0.2.85
+Version: 0.2.86
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0 and public domain
index c5eefa2..e0db2ec 100755 (executable)
@@ -52,8 +52,7 @@ static int __media_svc_is_root_path(const char *folder_path, bool *is_root, uid_
        }
        SAFE_FREE(internal_path);
 
-       if ((STRING_VALID(MEDIA_ROOT_PATH_SDCARD) && strncmp(folder_path, MEDIA_ROOT_PATH_SDCARD, strlen(MEDIA_ROOT_PATH_SDCARD)) == 0) ||
-               (STRING_VALID(MEDIA_ROOT_PATH_CLOUD) && strncmp(folder_path, MEDIA_ROOT_PATH_CLOUD, strlen(MEDIA_ROOT_PATH_CLOUD)) == 0)) {
+       if (STRING_VALID(MEDIA_ROOT_PATH_SDCARD) && strncmp(folder_path, MEDIA_ROOT_PATH_SDCARD, strlen(MEDIA_ROOT_PATH_SDCARD)) == 0) {
 
                start_len = strlen(MEDIA_ROOT_PATH_SDCARD);
                path_len = strlen(folder_path);
@@ -65,6 +64,10 @@ static int __media_svc_is_root_path(const char *folder_path, bool *is_root, uid_
 
                media_svc_debug("ROOT PATH [%s]", folder_path);
                *is_root = TRUE;
+       } else if ((STRING_VALID(MEDIA_ROOT_PATH_CLOUD) && strcmp(folder_path, MEDIA_ROOT_PATH_CLOUD) == 0) ||
+               (STRING_VALID(MEDIA_ROOT_PATH_DISC) && strcmp(folder_path, MEDIA_ROOT_PATH_DISC) == 0)) {
+               media_svc_debug("ROOT PATH [%s]", folder_path);
+               *is_root = TRUE;
        }
 
        return MS_MEDIA_ERR_NONE;
@@ -257,6 +260,8 @@ static int __media_svc_get_and_append_parent_folder(sqlite3 *handle, const char
                next_pos = strlen(MEDIA_ROOT_PATH_CLOUD);
        else if (STRING_VALID(MEDIA_ROOT_PATH_EXTERNAL) && strncmp(path, MEDIA_ROOT_PATH_EXTERNAL, strlen(MEDIA_ROOT_PATH_EXTERNAL)) == 0)
                next_pos = strlen(MEDIA_ROOT_PATH_EXTERNAL);
+       else if (STRING_VALID(MEDIA_ROOT_PATH_DISC) && strncmp(path, MEDIA_ROOT_PATH_DISC, strlen(MEDIA_ROOT_PATH_DISC)) == 0)
+               next_pos = strlen(MEDIA_ROOT_PATH_DISC);
        else {
                media_svc_error("Invalid Path");
                SAFE_FREE(internal_path);
index b448539..b5b57e9 100755 (executable)
@@ -2386,6 +2386,8 @@ int _media_svc_get_storage_type_by_path(const char *path, media_svc_storage_type
                        *storage_type = MEDIA_SVC_STORAGE_EXTERNAL;
                } else if (STRING_VALID(MEDIA_ROOT_PATH_USB) && (strncmp(path, MEDIA_ROOT_PATH_USB, strlen(MEDIA_ROOT_PATH_USB)) == 0)) {
                        *storage_type = MEDIA_SVC_STORAGE_EXTERNAL_USB;
+               } else if (STRING_VALID(MEDIA_ROOT_PATH_DISC) && (strncmp(path, MEDIA_ROOT_PATH_DISC, strlen(MEDIA_ROOT_PATH_DISC)) == 0)) {
+                       *storage_type = MEDIA_SVC_STORAGE_EXTERNAL;
                } else {
                        media_svc_error("Invalid Path");
                        SAFE_FREE(internal_path);