filter_h filter = NULL;
/*Set Filter*/
- char *condition = "(MEDIA_TYPE=0 OR MEDIA_TYPE=1)"; /*0-image, 1-video, 2-sound, 3-music, 4-other*/
+ char *condition = "(MEDIA_TYPE=0 OR MEDIA_TYPE=1) and MEDIA_PATH LIKE \'/opt/media/%%\'"; /*0-image, 1-video, 2-sound, 3-music, 4-other*/
ret = media_filter_create(&filter);
if(ret != MEDIA_CONTENT_ERROR_NONE) {
SETTING_TRACE_BEGIN;
double total_size = 0.0;
- int ret = SETTING_RETURN_SUCCESS;
- total_size = __setting_storage_main_folder_size_get(SETTING_STORAGE_DOWNLOADS_PATH);
- setting_retvm_if(ret == SETTING_RETURN_FAIL, total_size, "get downloads status failed");
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ filter_h filter = NULL;
+
+ /*Set Filter*/
+ char *condition = "MEDIA_PATH LIKE \'/opt/media/Downloads/%%\'";
+
+ ret = media_filter_create(&filter);
+ if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ SETTING_TRACE("Fail to create filter");
+ return total_size;
+ }
+
+ ret = media_filter_set_condition(filter, condition, MEDIA_CONTENT_COLLATE_DEFAULT);
+ if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ media_filter_destroy(filter);
+ SETTING_TRACE("Fail to set condition");
+ return total_size;
+ }
+
+ ret = media_info_foreach_media_from_db(filter, __setting_storage_main_media_item_cb, &total_size);
+ if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ media_filter_destroy(filter);
+ SETTING_TRACE("Fail to get media");
+ return total_size;
+ }
+
+ ret = media_filter_destroy(filter);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ SETTING_TRACE_ERROR("destroy filter failed\n\n");
+ return total_size;
+ }
return total_size;
}
filter_h filter = NULL;
/*Set Filter*/
- char *condition = "MEDIA_TYPE=3"; /*0-image, 1-video, 2-sound, 3-music, 4-other*/
+ char *condition = "MEDIA_TYPE=3 and MEDIA_PATH LIKE \'/opt/media/%%\'"; /*0-image, 1-video, 2-sound, 3-music, 4-other*/
ret = media_filter_create(&filter);
if(ret != MEDIA_CONTENT_ERROR_NONE) {