Remove unused code 38/140638/2
authorMinje Ahn <minje.ahn@samsung.com>
Wed, 26 Jul 2017 00:28:57 +0000 (09:28 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Wed, 26 Jul 2017 01:24:12 +0000 (10:24 +0900)
Change-Id: I412c3a167376370f32dc77dedb6aaab1fced347b
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/common/media-svc-util.c
src/include/common/media-svc-util.h

index a18aaed..a6a16aa 100755 (executable)
@@ -1692,7 +1692,7 @@ int _media_svc_extract_media_metadata(sqlite3 *handle, media_svc_content_info_s
                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);
@@ -1704,7 +1704,7 @@ int _media_svc_extract_media_metadata(sqlite3 *handle, media_svc_content_info_s
                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);
@@ -2000,12 +2000,6 @@ char *_media_svc_replace_path(char *s, const char *olds, const char *news)
                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)
@@ -2055,50 +2049,6 @@ bool _media_svc_check_pinyin_support(void)
        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;
index 8924b01..52bbefb 100755 (executable)
@@ -64,12 +64,10 @@ int _media_svc_extract_media_metadata(sqlite3 *handle, media_svc_content_info_s
 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