apply new path for the disc 82/98282/1 accepted/tizen/common/20161122.192755 accepted/tizen/ivi/20161122.235912 accepted/tizen/mobile/20161122.235706 accepted/tizen/tv/20161122.235749 accepted/tizen/wearable/20161122.235829 submit/tizen/20161122.044017
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 17 Nov 2016 02:16:07 +0000 (11:16 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Thu, 17 Nov 2016 02:16:07 +0000 (11:16 +0900)
Change-Id: Ia49f4f6a0b21dfbaa9cf806c671fed8efefa1da7
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 3c2bfd7e83b81722758d8ce170af7d05998b9542..d5010a8d517662f8cb844d3667abd5ff977e0d59 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 c5eefa27981e6573cdea9a12709485ce9837c151..b6f924d9c5a52fdd4a8e2f14d58e6ec8a3f50830 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);
@@ -63,6 +62,10 @@ static int __media_svc_is_root_path(const char *folder_path, bool *is_root, uid_
                                return MS_MEDIA_ERR_NONE;
                }
 
+               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;
        }
@@ -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 b448539fb9be041cfd6f1385e5e459e10aec73d4..b5b57e92a3d8939a954d0159e71e5d5bdf5f83fe 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);