int media_svc_send_dir_update_noti(MediaSvcHandle *handle, const char *dir_path);
+int media_svc_count_invalid_items_in_folder(MediaSvcHandle *handle, const char *folder_path, int *count);
+
/** @} */
/**
Name: libmedia-service
Summary: Media information service library for multimedia applications.
-Version: 0.2.32
+Version: 0.2.33
Release: 1
Group: System/Libraries
License: Apache License, Version 2.0
return MEDIA_SVC_PLUGIN_ERROR_NONE;
}
+
+int count_delete_items_in_folder(void * handle, const char *folder_path, int *count, char ** err_msg)
+{
+ int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
+
+ if(handle == NULL) {
+ __set_error_message(ERR_HANDLE, err_msg);
+ return MEDIA_SVC_PLUGIN_ERROR;
+ }
+
+ if(count == NULL) {
+ __set_error_message(ERR_HANDLE, err_msg);
+ return MEDIA_SVC_PLUGIN_ERROR;
+ }
+
+ if (!STRING_VALID(folder_path)) {
+ __set_error_message(ERR_FOLDER_PATH, err_msg);
+ return MEDIA_SVC_PLUGIN_ERROR;
+ }
+
+ ret = media_svc_count_invalid_items_in_folder(handle, folder_path, count);
+ if(ret < 0) {
+ __set_error_message(ret, err_msg);
+ return MEDIA_SVC_PLUGIN_ERROR;
+ }
+
+ return MEDIA_SVC_PLUGIN_ERROR_NONE;
+}
return MEDIA_INFO_ERROR_NONE;
}
+
+int _media_svc_count_invalid_folder_items(sqlite3 *handle, const char *folder_path, int *count)
+{
+ int ret = MEDIA_INFO_ERROR_NONE;
+ sqlite3_stmt *sql_stmt = NULL;
+ char *sql = sqlite3_mprintf("SELECT count(*) FROM %s WHERE validity=0 AND path LIKE '%q/%%'",
+ MEDIA_SVC_DB_TABLE_MEDIA, folder_path);
+
+ ret = _media_svc_sql_prepare_to_step(handle, sql, &sql_stmt);
+
+ if (ret != MEDIA_INFO_ERROR_NONE) {
+ media_svc_error("error when __media_svc_count_invalid_folder_records_with_thumbnail. err = [%d]", ret);
+ return ret;
+ }
+
+ *count = sqlite3_column_int(sql_stmt, 0);
+
+ SQLITE3_FINALIZE(sql_stmt);
+
+ return MEDIA_INFO_ERROR_NONE;
+}
\ No newline at end of file
return ret;
}
+
+int media_svc_count_invalid_items_in_folder(MediaSvcHandle *handle, const char *folder_path, int *count)
+{
+ sqlite3 * db_handle = (sqlite3 *)handle;
+
+ media_svc_debug_func();
+
+ media_svc_retvm_if(db_handle == NULL, MEDIA_INFO_ERROR_INVALID_PARAMETER, "Handle is NULL");
+ media_svc_retvm_if(folder_path == NULL, MEDIA_INFO_ERROR_INVALID_PARAMETER, "folder_path is NULL");
+ media_svc_retvm_if(count == NULL, MEDIA_INFO_ERROR_INVALID_PARAMETER, "count is NULL");
+
+ return _media_svc_count_invalid_folder_items(db_handle, folder_path, count);
+}
\ No newline at end of file
int _media_svc_get_media_id_by_path(sqlite3 *handle, const char *path, char *media_uuid, int max_length);
int _media_svc_update_thumbnail_path(sqlite3 *handle, const char *path, const char *thumb_path);
int _media_svc_get_noti_info(sqlite3 *handle, const char *path, int update_item, media_svc_noti_item **item);
+int _media_svc_count_invalid_folder_items(sqlite3 *handle, const char *folder_path, int *count);
#endif /*_MEDIA_SVC_MEDIA_H_*/