Change return type to bool
[platform/core/api/media-content.git] / src / media_info.c
index 75d45a0..791b1fb 100644 (file)
@@ -251,24 +251,23 @@ static int __media_info_insert_batch(const char **path_array,
 
 static int __media_info_check_file_validity(const char *path)
 {
-       bool ignore = FALSE;
        char *folder_path = NULL;
        int ret = MEDIA_CONTENT_ERROR_NONE;
 
        content_retvm_if(!STRING_VALID(path), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "invalid path");
 
-       ret = _media_util_check_ignore_file(path, &ignore);
-       content_retvm_if(ignore == TRUE, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid ignore path");
+       content_retvm_if(_media_util_is_ignorable_file(path), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid ignore path");
 
        ret = _media_util_check_file_exist(path);
        content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "invalid path");
 
        folder_path = g_path_get_dirname(path);
-       ret = _media_util_check_ignore_dir(folder_path, &ignore);
+       if (_media_util_is_ignorable_dir(folder_path))
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+
        g_free(folder_path);
-       content_retvm_if(ignore == TRUE, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid folder path");
 
-       return MEDIA_CONTENT_ERROR_NONE;
+       return ret;
 }
 
 void _media_info_item_get_detail(sqlite3_stmt* stmt, media_info_h media)