int media_svc_count_invalid_items_in_folder(MediaSvcHandle *handle, const char *storage_id, const char *folder_path, int *count);
int media_svc_check_db_upgrade(MediaSvcHandle *handle, int user_version, uid_t uid);
int media_svc_check_db_corrupt(MediaSvcHandle *handle);
-int media_svc_get_folder_list(MediaSvcHandle *handle, char *start_path, char ***folder_list, time_t **modified_time_list, int **item_num_list, int *count);
+int media_svc_get_folder_list(MediaSvcHandle *handle, char *start_path, char ***folder_list, time_t **modified_time_list, int *count);
int media_svc_update_folder_time(MediaSvcHandle *handle, const char *storage_id, const char *folder_path, uid_t uid);
int media_svc_publish_noti(media_item_type_e update_item, media_item_update_type_e update_type, const char *path, media_type_e media_type, const char *uuid, const char *mime_type);
int media_svc_get_pinyin(const char *src_str, char **pinyin_str);
return MEDIA_SVC_PLUGIN_ERROR_NONE;
}
-int get_folder_list(void *handle, const char *storage_id, char *start_path, char ***folder_list, int **modified_time_list, int **item_num_list, int *count, char **err_msg)
+int get_folder_list(void *handle, const char *storage_id, char *start_path, char ***folder_list, int **modified_time_list, int *count, char **err_msg)
{
int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
return MEDIA_SVC_PLUGIN_ERROR;
}
- ret = media_svc_get_folder_list(handle, start_path, folder_list, (time_t **)modified_time_list, item_num_list, count);
+ ret = media_svc_get_folder_list(handle, start_path, folder_list, (time_t **)modified_time_list, count);
if (ret < 0) {
__set_error_message(ret, err_msg);
return MEDIA_SVC_PLUGIN_ERROR;
return MS_MEDIA_ERR_NONE;
}
-int _media_svc_get_all_folders(sqlite3 *handle, char *start_path, char ***folder_list, time_t **modified_time_list, int **item_num_list, int *count)
+int _media_svc_get_all_folders(sqlite3 *handle, char *start_path, char ***folder_list, time_t **modified_time_list, int *count)
{
int ret = MS_MEDIA_ERR_NONE;
int idx = 0;
} else {
*folder_list = NULL;
*modified_time_list = NULL;
- *item_num_list = NULL;
return MS_MEDIA_ERR_NONE;
}
*folder_list = malloc(sizeof(char *) * cnt);
*modified_time_list = malloc(sizeof(int) * cnt);
- *item_num_list = malloc(sizeof(int) * cnt);
folder_uuid = malloc(sizeof(char *) * cnt);
- if ((*folder_list == NULL) || (*modified_time_list == NULL) || (*item_num_list == NULL) || (folder_uuid == NULL)) {
+ if ((*folder_list == NULL) || (*modified_time_list == NULL) || (folder_uuid == NULL)) {
media_svc_error("Out of memory");
goto ERROR;
}
}
SQLITE3_FINALIZE(sql_stmt);
- /*get the numbder of item in the folder by using folder's id */
- for (i = 0; i < idx; i++) {
- if (STRING_VALID(folder_uuid[i])) {
- sql = sqlite3_mprintf("SELECT COUNT(*) FROM %s WHERE (folder_uuid='%q' AND validity = 1)", MEDIA_SVC_DB_TABLE_MEDIA, folder_uuid[i]);
- ret = _media_svc_sql_prepare_to_step(handle, sql, &sql_stmt);
- if (ret != MS_MEDIA_ERR_NONE) {
- media_svc_error("prepare error [%s]", sqlite3_errmsg(handle));
- goto ERROR;
- }
-
- (*item_num_list)[i] = (int)sqlite3_column_int(sql_stmt, 0);
-
- SQLITE3_FINALIZE(sql_stmt);
- } else {
- media_svc_error("Invalid Folder Id");
- }
- }
-
if (cnt == idx) {
*count = cnt;
media_svc_debug("Get Folder is OK");
}
SAFE_FREE(*folder_list);
SAFE_FREE(*modified_time_list);
- SAFE_FREE(*item_num_list);
SAFE_FREE(folder_uuid);
*count = 0;
return _media_db_check_corrupt(db_handle);
}
-int media_svc_get_folder_list(MediaSvcHandle *handle, char *start_path, char ***folder_list, time_t **modified_time_list, int **item_num_list, int *count)
+int media_svc_get_folder_list(MediaSvcHandle *handle, char *start_path, char ***folder_list, time_t **modified_time_list, int *count)
{
sqlite3 *db_handle = (sqlite3 *)handle;
media_svc_retvm_if(db_handle == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "Handle is NULL");
media_svc_retvm_if(count == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "count is NULL");
- return _media_svc_get_all_folders(db_handle, start_path, folder_list, modified_time_list, item_num_list, count);
+ return _media_svc_get_all_folders(db_handle, start_path, folder_list, modified_time_list, count);
}
int media_svc_update_folder_time(MediaSvcHandle *handle, const char *storage_id, const char *folder_path, uid_t uid)
int _media_svc_get_and_append_folder(sqlite3 *handle, const char *storage_id, const char *path, media_svc_storage_type_e storage_type, char *folder_id, uid_t uid);
int _media_svc_get_and_append_folder_id_by_path(sqlite3 *handle, const char *storage_id, const char *path, media_svc_storage_type_e storage_type, char *folder_id, uid_t uid);
int _media_svc_update_folder_table(const char *storage_id, uid_t uid);
-int _media_svc_get_all_folders(sqlite3 *handle, char *start_path, char ***folder_list, time_t **modified_time_list, int **item_num_list, int *count);
+int _media_svc_get_all_folders(sqlite3 *handle, char *start_path, char ***folder_list, time_t **modified_time_list, int *count);
int _media_svc_get_and_append_folder_id_by_folder_path(sqlite3 *handle, const char *storage_id, const char *path, media_svc_storage_type_e storage_type, char *folder_id, bool stack_query, uid_t uid);
int _media_svc_get_folder_info_by_foldername(sqlite3 *handle, const char *storage_id, const char *folder_name, char *folder_id, time_t *modified_time);
int _media_svc_delete_invalid_folder(const char *storage_id, int storage_type, uid_t uid);