From: Minje Ahn Date: Thu, 30 Jan 2020 08:16:25 +0000 (+0900) Subject: Remove unnecessary return value X-Git-Tag: accepted/tizen/unified/20200207.122432~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41ab802771b8366b3e43a670557de761c7dea409;p=platform%2Fcore%2Fmultimedia%2Flibmedia-service.git Remove unnecessary return value Change-Id: I2d769f6a5d5c74c7bc17ab095ba23de0b098e226 Signed-off-by: Minje Ahn --- diff --git a/src/common/media-svc-util.c b/src/common/media-svc-util.c index 49a7804..a485686 100644 --- a/src/common/media-svc-util.c +++ b/src/common/media-svc-util.c @@ -663,20 +663,13 @@ static char *__media_svc_get_title_from_filepath(const char *path) return title; } -int _media_svc_remove_file(const char *path) +void _media_svc_remove_file(const char *path) { - int result = -1; - - media_svc_retvm_if(!STRING_VALID(path), MS_MEDIA_ERR_INVALID_PARAMETER, "path is NULL"); + if (!STRING_VALID(path)) + return; - result = remove(path); - if (result == 0) { - media_svc_debug("success to remove file"); - return MS_MEDIA_ERR_NONE; - } else { + if (remove(path) != 0) media_svc_stderror("fail to remove file result"); - return MS_MEDIA_ERR_INTERNAL; - } } int _media_svc_get_thumbnail_path(media_svc_media_type_e media_type, char *thumb_path, const char *pathname, const char *img_format, uid_t uid) @@ -1292,7 +1285,7 @@ int _media_svc_extract_media_metadata(sqlite3 *handle, bool is_direct, media_svc (content_info->media_type == MEDIA_SVC_MEDIA_TYPE_VIDEO && strcmp(mime_type, "video/3gpp") == 0) || (content_info->media_type == MEDIA_SVC_MEDIA_TYPE_MUSIC && strcmp(mime_type, "video/3gpp") == 0) || (content_info->media_type == MEDIA_SVC_MEDIA_TYPE_MUSIC && strcmp(mime_type, "audio/mp4") == 0))) { - /*Creation time format is 2013-01-01 00:00:00. change it to 2013:01:01 00:00:00 like exif time format*/ + /*Creation time format is 2013-01-01 00:00:00 +0000. change it to 2013:01:01 00:00:00 like exif time format*/ char *time_info = g_strdup_printf("0000:00:00 00:00:00 +0000"); char *p_value = p; char *time_value = time_info; @@ -1318,8 +1311,6 @@ int _media_svc_extract_media_metadata(sqlite3 *handle, bool is_direct, media_svc content_info->timeline = __media_svc_get_timeline_from_str(content_info->media_meta.recorded_date); if (content_info->timeline == 0) content_info->timeline = content_info->modified_time; - else - media_svc_debug("Timeline : %ld", content_info->timeline); /* This is same as datetaken */ /* Remove compensation string */ @@ -1593,8 +1584,6 @@ void _media_svc_destroy_content_info(media_svc_content_info_s *content_info) SAFE_FREE(content_info->media_meta.composer_pinyin); SAFE_FREE(content_info->media_meta.copyright_pinyin); SAFE_FREE(content_info->media_meta.description_pinyin); - - return; } static void __media_svc_get_proper_thumb_size(unsigned int orig_w, unsigned int orig_h, unsigned int *thumb_w, unsigned int *thumb_h) diff --git a/src/common/media-svc.c b/src/common/media-svc.c index 3fc5c8e..99ce4f6 100755 --- a/src/common/media-svc.c +++ b/src/common/media-svc.c @@ -436,11 +436,7 @@ int media_svc_move_item(sqlite3 *handle, return ret; } - if (STRING_VALID(old_thumb_path)) { - ret = _media_svc_remove_file(old_thumb_path); - if (ret != MS_MEDIA_ERR_NONE) - media_svc_error("_media_svc_remove_file failed : %d", ret); - } + _media_svc_remove_file(old_thumb_path); /*move item*/ ret = _media_svc_update_item_by_path(src_path, dst_stg_id, dst_stg_type, dest_path, file_name, modified_time, folder_uuid, uid); @@ -551,11 +547,7 @@ int media_svc_delete_item_by_path(sqlite3 *handle, const char *storage_id, const _media_svc_destroy_noti_item(noti_item); /*Delete thumbnail*/ - if (STRING_VALID(thumb_path)) { - ret = _media_svc_remove_file(thumb_path); - if (ret != MS_MEDIA_ERR_NONE) - media_svc_error("fail to remove thumbnail file."); - } + _media_svc_remove_file(thumb_path); return MS_MEDIA_ERR_NONE; } @@ -586,11 +578,7 @@ int media_svc_refresh_item(sqlite3 *handle, bool is_direct, const char *storage_ } if (STRING_VALID(thumb_path)) { - if (g_file_test(thumb_path, G_FILE_TEST_EXISTS)) { - ret = _media_svc_remove_file(thumb_path); - if (ret != MS_MEDIA_ERR_NONE) - media_svc_error("_media_svc_remove_file failed : %s", thumb_path); - } + _media_svc_remove_file(thumb_path); ret = _media_svc_update_thumbnail_path(path, NULL, uid); if (ret != MS_MEDIA_ERR_NONE) { diff --git a/src/include/common/media-svc-util.h b/src/include/common/media-svc-util.h index 56e0d49..d3137a3 100755 --- a/src/include/common/media-svc-util.h +++ b/src/include/common/media-svc-util.h @@ -126,7 +126,7 @@ typedef enum { } media_svc_media_type_e; char *_media_info_generate_uuid(void); -int _media_svc_remove_file(const char *path); +void _media_svc_remove_file(const char *path); int _media_svc_get_thumbnail_path(media_svc_media_type_e media_type, char *thumb_path, const char *pathname, const char *img_format, uid_t uid); int _media_svc_get_file_time(const char *full_path); int _media_svc_set_default_value(media_svc_content_info_s *content_info, bool refresh);