mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_DATE, &p, &size, NULL);
if (mmf_error == FILEINFO_ERROR_NONE && size == 4) {
int year = 0;
- if ((p != NULL) && ((ret != __media_svc_safe_atoi(p, &year)) == MS_MEDIA_ERR_NONE)) {
+ if ((p != NULL) && (__media_svc_safe_atoi(p, &year) == MS_MEDIA_ERR_NONE)) {
content_info->media_meta.year = g_strdup(p);
} else {
media_svc_debug("Wrong Year Information [%s]", p);
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_RATING, &p, &size, NULL);
if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
int rate = 0;
- if (__media_svc_safe_atoi(p, &rate) == MS_MEDIA_ERR_NONE)
+ if ((p != NULL) && (__media_svc_safe_atoi(p, &rate) == MS_MEDIA_ERR_NONE))
content_info->media_meta.rating = rate;
} else {
SAFE_FREE(err_attr_name);
return g_strdup(result);
else
return NULL;
-
-}
-
-bool _media_svc_is_drm_file(const char *path)
-{
- return FALSE;
}
int _media_svc_request_thumbnail(const char *path, char *thumb_path, int max_length, uid_t uid)
return TRUE;
}
-char* _media_svc_get_title_from_path(const char *path)
-{
- char *filename = NULL;
- char *title = NULL;
- char *ext = NULL;
- int filename_len = -1;
- int new_title_len = -1;
-
- if (!path) {
- media_svc_error("path is NULL");
- return NULL;
- }
-
- filename = g_path_get_basename(path);
- if (!STRING_VALID(filename)) {
- media_svc_error("wrong file name");
- SAFE_FREE(filename);
- return NULL;
- }
-
- filename_len = strlen(filename);
-
- ext = g_strrstr(filename, ".");
- if (!ext) {
- media_svc_error("there is no file extention");
- return filename;
- }
-
- new_title_len = filename_len - strlen(ext);
- if (new_title_len < 1) {
- media_svc_error("title length is zero");
- SAFE_FREE(filename);
- return NULL;
- }
-
- title = g_strndup(filename, new_title_len < MEDIA_SVC_PATHNAME_SIZE ? new_title_len : MEDIA_SVC_PATHNAME_SIZE-1);
-
- SAFE_FREE(filename);
-
- media_svc_debug("extract title is [%s]", title);
-
- return title;
-}
-
int _media_svc_get_media_type(const char *path, int *mediatype)
{
int ret = MS_MEDIA_ERR_NONE;
time_t __media_svc_get_timeline_from_str(const char *timstr);
void _media_svc_destroy_content_info(media_svc_content_info_s *content_info);
char *_media_svc_replace_path(char *s, const char *olds, const char *news);
-bool _media_svc_is_drm_file(const char *path);
int _media_svc_request_thumbnail(const char *path, char *thumb_path, int max_length, uid_t uid);
int _media_svc_get_pinyin_str(const char *src_str, char **pinyin_str);
bool _media_svc_check_pinyin_support(void);
int _media_svc_extract_music_metadata_for_update(sqlite3 *handle, media_svc_content_info_s *content_info, media_svc_media_type_e media_type);
-char *_media_svc_get_title_from_path(const char *path);
int _media_svc_get_media_type(const char *path, int *mediatype);
#ifdef __cplusplus