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)
(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;
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 */
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)
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);
_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;
}
}
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) {
} 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);