MS_DBG_WARN("DIRECTORY SCAN START [%.*s][%s][%d]", MAX_MSG_SIZE, scan_data->msg, scan_data->storage_id, scan_data->msg_type);
- g_mutex_lock(&scan_item_mutex);
- __msc_set_scan_item(&cur_scan_item, scan_data->msg, scan_data->pid);
- g_mutex_unlock(&scan_item_mutex);
+ if (strlen(scan_data->storage_id) == 0) {
+ MS_DBG_ERR("storage_id length is 0");
+ ret = MS_MEDIA_ERR_INVALID_PARAMETER;
+ goto NEXT;
+ }
- g_directory_scan_processing2 = DIR_SCAN_NON_RECURSIVE;
- uid = scan_data->uid;
+ if (scan_data->msg_type != MS_MSG_DIRECTORY_SCANNING &&
+ scan_data->msg_type != MS_MSG_DIRECTORY_SCANNING_NON_RECURSIVE) {
+ MS_DBG_ERR("Invalid request");
+ ret = MS_MEDIA_ERR_INVALID_PARAMETER;
+ goto NEXT;
+ }
- /*connect to media db, if connecting is failed, db updating is stopped*/
- ret = ms_connect_db(&handle, uid);
+ ret = ms_connect_db(&handle, scan_data->uid);
if (ret != MS_MEDIA_ERR_NONE) {
MS_DBG_ERR("ms_connect_db failed");
goto NEXT;
if (__msc_check_remain_space(uid) != MS_MEDIA_ERR_NONE)
goto SCAN_DONE;
- scan_type = scan_data->msg_type;
- storage_id = g_strdup(scan_data->storage_id);
-
- MS_DBG("path [%.*s], storage_id [%s], scan_type [%d]", MAX_MSG_SIZE, scan_data->msg, storage_id, scan_type);
+ g_mutex_lock(&scan_item_mutex);
+ __msc_set_scan_item(&cur_scan_item, scan_data->msg, scan_data->pid);
+ g_mutex_unlock(&scan_item_mutex);
- if (strlen(storage_id) == 0) {
- MS_DBG_ERR("storage_id length is 0. There is no information of your request [%.*s]", MAX_MSG_SIZE, scan_data->msg);
- ret = MS_MEDIA_ERR_INVALID_PARAMETER;
- goto NEXT;
- }
+ g_directory_scan_processing2 = DIR_SCAN_NON_RECURSIVE;
+ uid = scan_data->uid;
- if (scan_type != MS_MSG_DIRECTORY_SCANNING
- && scan_type != MS_MSG_DIRECTORY_SCANNING_NON_RECURSIVE) {
- MS_DBG_ERR("Invalid request");
- ret = MS_MEDIA_ERR_INVALID_PARAMETER;
- goto NEXT;
- }
+ scan_type = scan_data->msg_type;
+ storage_id = g_strdup(scan_data->storage_id);
ms_trim_dir_path(scan_data->msg);