From 56605b9e33c21cf1471adf85d2dbbb7289586c30 Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Thu, 29 Nov 2018 10:45:44 +0900 Subject: [PATCH] Change storage type function Use media-util function instead Change-Id: I2447446f63e681a5ecd18db09a20064459b7ec05 Signed-off-by: Minje Ahn --- src/media_content.c | 12 ++++++------ src/media_folder.c | 6 +++--- src/media_info.c | 6 +++--- src/media_util_private.c | 14 +++++++------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/media_content.c b/src/media_content.c index ebc8d68..8a31c0f 100755 --- a/src/media_content.c +++ b/src/media_content.c @@ -597,11 +597,11 @@ int media_content_scan_file(const char *path) /* check feature */ media_content_retvm_if(!_media_util_check_support_media_type(repl_path), MEDIA_CONTENT_ERROR_NOT_SUPPORTED, "Unsupported media type"); - media_svc_storage_type_e storage_type; + ms_user_storage_type_e storage_type; - ret = media_svc_get_storage_type(repl_path, &storage_type, _content_get_uid()); + ret = ms_user_get_storage_type(_content_get_uid(), repl_path, &storage_type); if (ret != MS_MEDIA_ERR_NONE) { - media_content_sec_error("media_svc_get_storage_type failed : %d (%s)", ret, repl_path); + media_content_sec_error("ms_user_get_storage_type failed : %d (%s)", ret, repl_path); return _content_error_capi(MEDIA_CONTENT_TYPE, ret); } ret = media_svc_check_item_exist_by_path(_content_get_db_handle(), storage_id, repl_path); @@ -717,7 +717,7 @@ int media_content_scan_folder(const char *path, bool is_recursive, media_scan_co bool ignore_dir = FALSE; char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0, }; char repl_path[MAX_PATH_LEN] = {0, }; - media_svc_storage_type_e storage_type = MEDIA_SVC_STORAGE_MAX; + ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL; media_content_retvm_if(!STRING_VALID(path), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid path"); memset(repl_path, 0, sizeof(repl_path)); @@ -736,9 +736,9 @@ int media_content_scan_folder(const char *path, bool is_recursive, media_scan_co } else { /* This means this folder has to be deleted */ /* Or, it is real invalid path.. check storage type */ - ret = media_svc_get_storage_type(repl_path, &storage_type, _content_get_uid()); + ret = ms_user_get_storage_type(_content_get_uid(), repl_path, &storage_type); if (ret != MS_MEDIA_ERR_NONE) { - media_content_sec_error("media_svc_get_storage_type failed : %d (%s)", ret, repl_path); + media_content_sec_error("ms_user_get_storage_type failed : %d (%s)", ret, repl_path); return _content_error_capi(MEDIA_CONTENT_TYPE, ret); } diff --git a/src/media_folder.c b/src/media_folder.c index 5462ac1..49f3ded 100755 --- a/src/media_folder.c +++ b/src/media_folder.c @@ -377,11 +377,11 @@ int media_folder_insert_to_db(const char *path) ret = media_svc_check_folder_exist_by_path(_content_get_db_handle(), storage_id, repl_path); if (ret == MS_MEDIA_ERR_DB_NO_RECORD) { media_content_sec_debug("media_svc_check_folder_exist_by_path : no record : %s", repl_path); - media_svc_storage_type_e storage_type = 0; + ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL; - ret = media_svc_get_storage_type(repl_path, &storage_type, _content_get_uid()); + ret = ms_user_get_storage_type(_content_get_uid(), repl_path, &storage_type); if (ret != MS_MEDIA_ERR_NONE) { - media_content_sec_error("media_svc_get_storage_type failed : %d", ret); + media_content_sec_error("ms_user_get_storage_type failed : %d", ret); return _content_error_capi(MEDIA_CONTENT_TYPE, ret); } diff --git a/src/media_info.c b/src/media_info.c index f9b879f..fe3019e 100755 --- a/src/media_info.c +++ b/src/media_info.c @@ -415,11 +415,11 @@ int media_info_insert_to_db(const char *path, media_info_h *info) if (ret == MS_MEDIA_ERR_DB_NO_RECORD) { media_content_sec_debug("media_svc_check_item_exist_by_path : no record : %s", repl_path); media_content_retvm_if(!_media_util_check_support_media_type(repl_path), MEDIA_CONTENT_ERROR_NOT_SUPPORTED, "Unsupported media type"); - media_svc_storage_type_e storage_type = 0; + ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL; - ret = media_svc_get_storage_type(repl_path, &storage_type, _content_get_uid()); + ret = ms_user_get_storage_type(_content_get_uid(), repl_path, &storage_type); if (ret != MS_MEDIA_ERR_NONE) { - media_content_sec_error("media_svc_get_storage_type failed : %d", ret); + media_content_sec_error("ms_user_get_storage_type failed : %d", ret); return _content_error_capi(MEDIA_CONTENT_TYPE, ret); } diff --git a/src/media_util_private.c b/src/media_util_private.c index 3a63c51..64a608a 100755 --- a/src/media_util_private.c +++ b/src/media_util_private.c @@ -184,7 +184,7 @@ int _media_util_check_ignore_file(const char *path, bool *ignore) int _media_util_check_ignore_dir(const char *dir_path, bool *ignore) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_svc_storage_type_e storage_type = 0; + ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL; const char *scan_ignore = ".scan_ignore"; bool find = false; GDir *dir = NULL; @@ -204,9 +204,9 @@ int _media_util_check_ignore_dir(const char *dir_path, bool *ignore) } /*2. Check Scan Ignore Directory*/ - ret = media_svc_get_storage_type(dir_path, &storage_type, _content_get_uid()); + ret = ms_user_get_storage_type(_content_get_uid(), dir_path, &storage_type); if (ret != MS_MEDIA_ERR_NONE) { - media_content_error("media_svc_get_storage_type failed : %d", ret); + media_content_error("ms_user_get_storage_type failed : %d", ret); return _content_error_capi(MEDIA_CONTENT_TYPE, ret); } @@ -249,13 +249,13 @@ int _media_util_check_ignore_dir(const char *dir_path, bool *ignore) break; } else { /*If root path, Stop Scanning*/ - if ((storage_type == MEDIA_SVC_STORAGE_INTERNAL) && (STRING_VALID(MEDIA_ROOT_PATH_INTERNAL) && g_strcmp0(search_path, MEDIA_ROOT_PATH_INTERNAL) == 0)) { + if ((storage_type == MS_USER_STORAGE_INTERNAL) && (STRING_VALID(MEDIA_ROOT_PATH_INTERNAL) && g_strcmp0(search_path, MEDIA_ROOT_PATH_INTERNAL) == 0)) { break; - } else if ((storage_type == MEDIA_SVC_STORAGE_EXTERNAL) && (STRING_VALID(MEDIA_ROOT_PATH_SDCARD)) && (g_strcmp0(search_path, MEDIA_ROOT_PATH_SDCARD) == 0)) { + } else if ((storage_type == MS_USER_STORAGE_EXTERNAL) && (STRING_VALID(MEDIA_ROOT_PATH_SDCARD)) && (g_strcmp0(search_path, MEDIA_ROOT_PATH_SDCARD) == 0)) { break; - } else if ((storage_type == MEDIA_SVC_STORAGE_EXTERNAL_USB) && (STRING_VALID(MEDIA_ROOT_PATH_DISC)) && (g_strcmp0(search_path, MEDIA_ROOT_PATH_DISC) == 0)) { + } else if ((storage_type == MS_USER_STORAGE_EXTERNAL_USB) && (STRING_VALID(MEDIA_ROOT_PATH_DISC)) && (g_strcmp0(search_path, MEDIA_ROOT_PATH_DISC) == 0)) { break; - } else if (storage_type == MEDIA_SVC_STORAGE_EXTERNAL_USB) { + } else if (storage_type == MS_USER_STORAGE_EXTERNAL_USB) { char *parent_folder_path = NULL; bool is_root = FALSE; -- 2.7.4