Name: media-server
Summary: A server for media content management
-Version: 0.3.62
+Version: 0.3.63
Release: 0
Group: Multimedia/Service
License: Apache-2.0
#define LAST_EVENT 1
#define NORMAL_EVENT 0
-static int __msc_check_extract_stop_status(int scan_type, ms_user_storage_type_e storage_type, const char *start_path, int pid, bool is_end);
+static int __msc_check_extract_stop_status(int scan_type, const char *start_path, int pid, bool is_end);
static int __msc_set_storage_extract_status(ms_storage_scan_status_e status);
static int __msc_get_storage_extract_status(ms_storage_scan_status_e *status);
static int __msc_resume_extract();
tmp_ret = MS_MEDIA_ERR_NONE;
db_data = NULL;
- ret = __msc_check_extract_stop_status(scan_type, storage_type, path, pid, is_end);
+ ret = __msc_check_extract_stop_status(scan_type, path, pid, is_end);
if (ret == MS_MEDIA_ERR_SCANNER_FORCE_STOP) {
MS_DBG_ERR("__msc_folder_bulk_extract MS_MEDIA_ERR_SCANNER_FORCE_STOP");
break;
goto NEXT;
}
- ret = __msc_check_extract_stop_status(extract_data->msg_type, storage_type, update_path, extract_data->pid, end_flag);
+ ret = __msc_check_extract_stop_status(extract_data->msg_type, update_path, extract_data->pid, end_flag);
if (ret == MS_MEDIA_ERR_SCANNER_FORCE_STOP) {
MS_DBG_ERR("MS_MEDIA_ERR_SCANNER_FORCE_STOP");
__msc_pause_extract();
MS_DBG_WARN("extract RESUME");
- int tem_ret = __msc_check_extract_stop_status(extract_data->msg_type, storage_type, update_path, extract_data->pid, end_flag);
+ int tem_ret = __msc_check_extract_stop_status(extract_data->msg_type, update_path, extract_data->pid, end_flag);
if (tem_ret == MS_MEDIA_ERR_SCANNER_FORCE_STOP) {
ms_set_storage_scan_status(handle, extract_data->storage_id, MEDIA_EXTRACT_STOP, uid);
__msc_set_storage_extract_status(MS_STORAGE_SCAN_META_STOP);
return MS_MEDIA_ERR_NONE;
}
-static int __msc_check_extract_stop_status(int scan_type, ms_user_storage_type_e storage_type, const char *start_path, int pid, bool is_end)
+static int __msc_check_extract_stop_status(int scan_type, const char *start_path, int pid, bool is_end)
{
int ret = MS_MEDIA_ERR_NONE;
#define BUF_SIZE 1024
-static int __msc_check_stop_status(int scan_type, ms_user_storage_type_e storage_type, const char *start_path, int pid);
+static int __msc_check_stop_status(int scan_type, const char *start_path, int pid);
static int __msc_db_update(void **handle, const char *storage_id, const ms_comm_msg_s * scan_data);
static int __msc_make_file_list(char *file_path, GArray **path_array, uid_t uid);
static int __msc_batch_insert(ms_msg_type_e current_msg, int pid, GArray *path_array, uid_t uid);
return MS_MEDIA_ERR_NONE;
}
-static int __msc_check_stop_status(int scan_type, ms_user_storage_type_e storage_type, const char *start_path, int pid)
+static int __msc_check_stop_status(int scan_type, const char *start_path, int pid)
{
int ret = MS_MEDIA_ERR_NONE;
/*start db update. the number of element in the array , db update is complete.*/
while (dir_array->len != 0) {
/*check poweroff status*/
- ret = __msc_check_stop_status(scan_type, storage_type, new_start_path, pid);
+ ret = __msc_check_stop_status(scan_type, new_start_path, pid);
if (ret != MS_MEDIA_ERR_NONE) {
if (is_recursive == true)
ms_change_validity_item_batch(handle, storage_id, new_start_path, 1, 2, uid);
}
/*check poweroff status*/
- ret = __msc_check_stop_status(scan_type, storage_type, new_start_path, pid);
+ ret = __msc_check_stop_status(scan_type, new_start_path, pid);
if (ret != MS_MEDIA_ERR_NONE) {
if (is_recursive == true)
ms_change_validity_item_batch(handle, storage_id, new_start_path, 1, 2, uid);
for (bpos = 0; bpos < nread;) {
/*check poweroff status*/
- ret = __msc_check_stop_status(scan_type, storage_type, new_start_path, pid);
+ ret = __msc_check_stop_status(scan_type, new_start_path, pid);
if (ret != MS_MEDIA_ERR_NONE) {
if (is_recursive == true)
ms_change_validity_item_batch(handle, storage_id, new_start_path, 1, 2, uid);
if (scan_count >= MAX_SCAN_COUNT) {
scan_count = 0;
//MS_DBG_ERR("storage_id = [%s]", storage_id);
- ret = __msc_check_stop_status(scan_type, storage_type, new_start_path, pid);
+ ret = __msc_check_stop_status(scan_type, new_start_path, pid);
if (ret == MS_MEDIA_ERR_NONE) {
msc_insert_exactor_request(scan_type, FALSE, storage_id, current_path, pid, uid, MS_ITEM_UPDATE);
} else {
/*start db update. the number of element in the array , db update is complete.*/
while (dir_array->len != 0) {
/*check poweroff status*/
- ret = __msc_check_stop_status(scan_type, storage_type, new_start_path, pid);
+ ret = __msc_check_stop_status(scan_type, new_start_path, pid);
if (ret != MS_MEDIA_ERR_NONE)
goto STOP_SCAN;
}
/*check poweroff status*/
- ret = __msc_check_stop_status(scan_type, storage_type, new_start_path, pid);
+ ret = __msc_check_stop_status(scan_type, new_start_path, pid);
if (ret != MS_MEDIA_ERR_NONE)
goto STOP_SCAN;
for (bpos = 0; bpos < nread;) {
/*check poweroff status*/
- ret = __msc_check_stop_status(scan_type, storage_type, new_start_path, pid);
+ ret = __msc_check_stop_status(scan_type, new_start_path, pid);
if (ret != MS_MEDIA_ERR_NONE)
goto STOP_SCAN;
while (1) {
sleep(1);
- ret = __msc_check_stop_status(scan_type, storage_type, scan_data->msg, scan_data->pid);
+ ret = __msc_check_stop_status(scan_type, scan_data->msg, scan_data->pid);
if (ret != MS_MEDIA_ERR_NONE)
goto NEXT;
while (1) {
sleep(1);
- ret = __msc_check_stop_status(scan_type, storage_type, scan_data->msg, scan_data->pid);
+ ret = __msc_check_stop_status(scan_type, scan_data->msg, scan_data->pid);
if (ret != MS_MEDIA_ERR_NONE)
goto NEXT;
static int __msc_clear_file_list(GArray *path_array);
-static int __msc_check_stop_status(ms_user_storage_type_e storage_type)
+static int __msc_check_stop_status()
{
if (power_off) {
MS_DBG_ERR("Power off");
}
}
-static int __msc_dir_scan(void **handle, const char *storage_id, const char*start_path, ms_user_storage_type_e storage_type, bool check_exists, bool is_recursive, uid_t uid)
+static int __msc_dir_scan(void **handle, const char *storage_id, const char*start_path, bool check_exists, bool is_recursive, uid_t uid)
{
int ret = MS_MEDIA_ERR_NONE;
GDir *dir = NULL;
scan_function = (check_exists == false) ? ms_insert_item_batch : ms_validate_item;
while (dir_array->len != 0) {
- ret = __msc_check_stop_status(storage_type);
+ ret = __msc_check_stop_status();
if (ret != MS_MEDIA_ERR_NONE)
goto STOP_SCAN;
MS_DBG_ERR("insert folder failed");
while ((name = g_dir_read_name(dir))) {
- ret = __msc_check_stop_status(storage_type);
+ ret = __msc_check_stop_status();
if (ret != MS_MEDIA_ERR_NONE) {
ms_insert_folder_end(handle, uid);
goto STOP_SCAN;
if (scan_type != MS_MSG_STORAGE_INVALID) {
MS_DBG_INFO("INSERT");
if (scan_type == MS_MSG_STORAGE_ALL)
- err = __msc_dir_scan(handle, storage_id, start_path, storage_type, false, true, scan_data->uid);
+ err = __msc_dir_scan(handle, storage_id, start_path, false, true, scan_data->uid);
else
- err = __msc_dir_scan(handle, storage_id, start_path, storage_type, true, true, scan_data->uid);
+ err = __msc_dir_scan(handle, storage_id, start_path, true, true, scan_data->uid);
if (err != MS_MEDIA_ERR_NONE)
MS_DBG_ERR("error : %d", err);
ms_bacth_commit_enable(handle, TRUE, TRUE, MS_NOTI_SWITCH_OFF, 0);
if (noti_type == MS_ITEM_INSERT)
- ret = __msc_dir_scan(handle, storage_id, start_path, storage_type, false, is_recursive, scan_data->uid);
+ ret = __msc_dir_scan(handle, storage_id, start_path, false, is_recursive, scan_data->uid);
else
- ret = __msc_dir_scan(handle, storage_id, start_path, storage_type, true, is_recursive, scan_data->uid);
+ ret = __msc_dir_scan(handle, storage_id, start_path, true, is_recursive, scan_data->uid);
ms_bacth_commit_disable(handle, TRUE, TRUE, scan_data->uid);
return false;
}
-static int __msc_dir_scan_meta_update(void **handle, const char*start_path, const char *storage_id, ms_user_storage_type_e storage_type, uid_t uid)
+static int __msc_dir_scan_meta_update(void **handle, const char*start_path, const char *storage_id, uid_t uid)
{
int ret = MS_MEDIA_ERR_NONE;
GDir *dir = NULL;
g_array_append_val(dir_array, tmp_path);
while (dir_array->len != 0) {
- ret = __msc_check_stop_status(storage_type);
+ ret = __msc_check_stop_status();
if (ret != MS_MEDIA_ERR_NONE)
goto STOP_SCAN;
dir = g_dir_open(current_path, 0, &error);
if (error == NULL && dir != NULL) {
while ((name = g_dir_read_name(dir))) {
- ret = __msc_check_stop_status(storage_type);
+ ret = __msc_check_stop_status();
if (ret != MS_MEDIA_ERR_NONE)
goto STOP_SCAN;
int ret = MS_MEDIA_ERR_NONE;
int idx = 0;
void **handle = NULL;
- ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL;
GArray *storage_list = NULL;
ms_stg_info_s *stg_info = NULL;
char *usr_path = NULL;
return MS_MEDIA_ERR_INTERNAL;
}
- ret = __msc_dir_scan_meta_update(handle, usr_path, INTERNAL_STORAGE_ID, storage_type, scan_data->uid);
+ ret = __msc_dir_scan_meta_update(handle, usr_path, INTERNAL_STORAGE_ID, scan_data->uid);
/* send notification */
ms_send_dir_update_noti(handle, INTERNAL_STORAGE_ID, usr_path, NULL, MS_ITEM_UPDATE, scan_data->pid);
MS_SAFE_FREE(usr_path);
continue;
}
- ret = __msc_dir_scan_meta_update(handle, stg_info->stg_path, stg_info->storage_id, storage_type, scan_data->uid);
+ ret = __msc_dir_scan_meta_update(handle, stg_info->stg_path, stg_info->storage_id, scan_data->uid);
/* send notification */
ms_send_dir_update_noti(handle, stg_info->storage_id, stg_info->stg_path, NULL, MS_ITEM_UPDATE, scan_data->pid);