goto STOP_SCAN;
}
- ms_batch_commit_disable(uid);
- ms_batch_commit_enable(false, pid);
+ ms_register_end(uid);
+ ms_register_start(false, 0);
current_path = g_ptr_array_index(dir_array, 0);
g_ptr_array_remove_index(dir_array, 0);
g_ptr_array_free(dir_array, TRUE);
- ms_batch_commit_disable(uid);
+ ms_register_end(uid);
if (ret != MS_MEDIA_ERR_NONE)
MS_DBG_INFO("ret : %d", ret);
scan_function = (scan_type == MS_MSG_STORAGE_ALL) ? ms_scan_item_batch : ms_scan_validate_item;
- ms_batch_commit_disable(uid);
+ ms_register_end(uid);
while (dir_array->len != 0) {
ret = __msc_check_stop_status(scan_type, new_start_path, pid);
if (ret != MS_MEDIA_ERR_NONE)
goto STOP_SCAN;
- ms_batch_commit_enable(false, pid);
+ ms_register_start(false, 0);
current_path = g_ptr_array_index(dir_array, 0);
g_ptr_array_remove_index(dir_array, 0);
}
}
- ms_batch_commit_disable(uid);
+ ms_register_end(uid);
ms_set_folder_scan_status(handle, storage_id, current_path, MS_DIR_SCAN_DONE, uid);
if (dir) {
__msc_set_storage_scan_cur_path(NULL);
g_ptr_array_free(dir_array, TRUE);
- ms_batch_commit_disable(uid);
+ ms_register_end(uid);
if (ret != MS_MEDIA_ERR_NONE)
MS_DBG_INFO("ret : %d", ret);
MS_DBG_ERR("error : %d", ret);
}
- ms_batch_commit_enable(false, 0);
+ ms_register_start(false, 0);
ret = __msc_db_update(handle, scan_data->storage_id, scan_data);
- ms_batch_commit_disable(scan_data->uid);
+ ms_register_end(scan_data->uid);
MS_DBG_WARN("folder scan done, sent cb event path = [%.*s]", MAX_MSG_SIZE, scan_data->msg);
ms_set_db_status(MS_DB_UPDATING, storage_type);
if (scan_data->msg_type != MS_MSG_STORAGE_INVALID)
- ms_batch_commit_enable(false, 0);
+ ms_register_start(false, 0);
if (scan_data->msg_type == MS_MSG_STORAGE_ALL) {
if (ms_delete_invalid_items(handle, scan_data->storage_id, scan_data->uid) != MS_MEDIA_ERR_NONE)
ret = __msc_db_update(handle, scan_data->storage_id, scan_data);
if (scan_data->msg_type != MS_MSG_STORAGE_INVALID)
- ms_batch_commit_disable(scan_data->uid);
+ ms_register_end(scan_data->uid);
if (scan_data->msg_type == MS_MSG_STORAGE_PARTIAL && ret == MS_MEDIA_ERR_NONE) {
ms_delete_invalid_folder(scan_data->storage_id, scan_data->uid);
ret = ms_connect_db(&handle, uid);
MS_DBG_RETV_IF(ret != MS_MEDIA_ERR_NONE, MS_MEDIA_ERR_DB_INTERNAL);
- ms_batch_commit_enable(true, pid);
+ ms_register_start(true, pid);
for (i = 0; i < path_array->len; i++) {
insert_path = g_ptr_array_index(path_array, i);
}
/*call for bundle commit*/
- ms_batch_commit_disable(uid);
+ ms_register_end(uid);
ms_disconnect_db(handle);
MS_DBG_FLEAVE();
start_path = g_strdup(scan_data->msg);
- ms_batch_commit_enable(false, 0);
+ ms_register_start(false, 0);
ret = __msc_dir_scan(handle, scan_data->storage_id, start_path, false, is_recursive, scan_data->uid);
- ms_batch_commit_disable(scan_data->uid);
+ ms_register_end(scan_data->uid);
if (ret != MS_MEDIA_ERR_SCANNER_FORCE_STOP) {
MS_DBG_INFO("working normally");
return ret;
}
- ms_batch_commit_enable(false, 0);
+ ms_register_start(false, 0);
ret = __msc_dir_scan(handle, scan_data->storage_id, start_path, true, is_recursive, scan_data->uid);
- ms_batch_commit_disable(scan_data->uid);
+ ms_register_end(scan_data->uid);
if (ms_delete_invalid_items(handle, scan_data->storage_id, scan_data->uid) != MS_MEDIA_ERR_NONE)
MS_DBG_ERR("deleting invalid items in storage failed");
return ret;
}
- ms_batch_commit_enable(false, 0);
+ ms_register_start(false, 0);
ret = __msc_db_update(handle, scan_data->storage_id, scan_data);
- ms_batch_commit_disable(scan_data->uid);
+ ms_register_end(scan_data->uid);
if (ms_delete_invalid_items(handle, scan_data->storage_id, scan_data->uid) != MS_MEDIA_ERR_NONE)
MS_DBG_ERR("deleting invalid items in storage failed");
ms_set_db_status(MS_DB_UPDATING, storage_type);
- ms_batch_commit_enable(false, 0);
+ ms_register_start(false, 0);
ret = __msc_db_update(handle, scan_data->storage_id, scan_data);
- ms_batch_commit_disable(scan_data->uid);
+ ms_register_end(scan_data->uid);
ms_disconnect_db(handle);
ret = ms_connect_db(&handle, uid);
MS_DBG_RETV_IF(ret != MS_MEDIA_ERR_NONE, MS_MEDIA_ERR_DB_INTERNAL);
- ms_batch_commit_enable(true, pid);
+ ms_register_start(true, pid);
for (i = 0; i < path_array->len; i++) {
insert_path = g_ptr_array_index(path_array, i);
}
}
- /*call for bundle commit*/
- ms_batch_commit_disable(uid);
+ ms_register_end(uid);
ms_disconnect_db(handle);
MS_DBG_FLEAVE();