diff options
author | Haejeong Kim <backto.kim@samsung.com> | 2017-05-18 14:01:48 +0900 |
---|---|---|
committer | Haejeong Kim <backto.kim@samsung.com> | 2017-05-18 14:01:48 +0900 |
commit | 9854665b61c46ea62b0d4654228327c470be4826 (patch) | |
tree | a8c074b0f8c3fccdd62c8c5838c0de1b6e1b446d /src/media-thumb-internal.c | |
parent | beeba1d851b990b7ac150452489c289d2e96dc47 (diff) | |
download | libmedia-thumbnail-9854665b61c46ea62b0d4654228327c470be4826.tar.gz libmedia-thumbnail-9854665b61c46ea62b0d4654228327c470be4826.tar.bz2 libmedia-thumbnail-9854665b61c46ea62b0d4654228327c470be4826.zip |
Use Common API in libmedia-util to get storage_type instead of internal API
Change-Id: Id2f14227aa97ce28eda8c20c8882b0183dffc9e5
Diffstat (limited to 'src/media-thumb-internal.c')
-rwxr-xr-x | src/media-thumb-internal.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/media-thumb-internal.c b/src/media-thumb-internal.c index 28914f0..2d0ac3d 100755 --- a/src/media-thumb-internal.c +++ b/src/media-thumb-internal.c @@ -1611,7 +1611,8 @@ int _media_thumb_get_hash_name(const char *file_full_path, char file_ext[255] = { 0 }; char *get_path = NULL; int ret_len = 0; - media_thumb_store_type store_type = -1; + ms_user_storage_type_t store_type = -1; + int ret = 0; if (file_full_path == NULL || thumb_hash_path == NULL || max_thumb_path <= 0) { thumb_err("file_full_path==NULL || thumb_hash_path == NULL || max_thumb_path <= 0"); @@ -1620,14 +1621,11 @@ int _media_thumb_get_hash_name(const char *file_full_path, _media_thumb_get_file_ext(file_full_path, file_ext, sizeof(file_ext)); - store_type = _media_thumb_get_store_type_by_path(file_full_path); - /*if (store_type == THUMB_PHONE) { - thumb_dir = _media_thumb_phone_get_path(uid); - } else if (store_type == THUMB_MMC) { - thumb_dir = _media_thumb_mmc_get_path(uid); - } else { - thumb_dir = _media_thumb_phone_get_path(uid); - }*/ + ret = ms_user_get_storage_type(uid, file_full_path, &store_type); + if((ret != MS_MEDIA_ERR_NONE) || ((store_type != MS_USER_STORAGE_INTERNAL) && (store_type != MS_USER_STORAGE_EXTERNAL))) { + thumb_err("origin path(%s) is invalid. err : [%d] store_type [%d]", file_full_path, ret, store_type); + return MS_MEDIA_ERR_INVALID_PARAMETER; + } hash_name = _media_thumb_generate_hash_name(file_full_path); if (hash_name == NULL) { @@ -1635,11 +1633,11 @@ int _media_thumb_get_hash_name(const char *file_full_path, return MS_MEDIA_ERR_INTERNAL; } - if (store_type == THUMB_PHONE) { + if (store_type == MS_USER_STORAGE_INTERNAL) { get_path = _media_thumb_phone_get_path(uid); if (get_path != NULL) ret_len = snprintf(thumb_hash_path, max_thumb_path - 1, "%s/.%s-%s.jpg", get_path, file_ext, hash_name); - } else if (store_type == THUMB_MMC) { + } else if (store_type == MS_USER_STORAGE_EXTERNAL) { get_path = _media_thumb_mmc_get_path(uid); if (get_path != NULL) ret_len = snprintf(thumb_hash_path, max_thumb_path - 1, "%s/.%s-%s.jpg", get_path, file_ext, hash_name); |