MS_MSG_SCANNER_PARTIAL,
MS_MSG_SCANNER_COMPLETE,
MS_MSG_EXTRACTOR_COMPLETE,
+ MS_MSG_RECURSIVE_START,
MS_MSG_MEDIA_DB_RESET, /**< media DB is reset*/
MS_MSG_MEDIA_DB_MALFORMED,
MS_MSG_MAX /**< Invalid msg type */
MEDIA_REQUEST_SCAN_PARTIAL,
MEDIA_REQUEST_SCAN_COMPLETE,
MEDIA_REQUEST_EXTRACT_COMPLETE,
+ MEDIA_RECURSIVE_START,
} media_request_type_e;
typedef struct {
case MS_MSG_SCANNER_PARTIAL:
req_result.request_type = MEDIA_REQUEST_SCAN_PARTIAL;
break;
+ case MS_MSG_RECURSIVE_START:
+ req_result.request_type = MEDIA_RECURSIVE_START;
+ break;
case MS_MSG_EXTRACTOR_COMPLETE:
req_result.request_type = MEDIA_REQUEST_EXTRACT_COMPLETE;
break;
if ((recv_msg.msg_type != MS_MSG_SCANNER_COMPLETE) &&
(recv_msg.msg_type != MS_MSG_SCANNER_PARTIAL) &&
+ (recv_msg.msg_type != MS_MSG_RECURSIVE_START) &&
req_result.complete_path != NULL) {
/*NEED MUTEX*/
g_mutex_lock(&scan_req_mutex);
if (MS_MEDIA_ERR_NONE == err) {
MS_DBG_WARN("[%.*s] is scanning recursive, waiting...", MAX_MSG_SIZE, scan_data->msg);
-
+ msc_send_result_partial(ret, MS_MSG_RECURSIVE_START, scan_data->pid, scan_data->msg);
while (1) {
sleep(1);
ms_set_folder_item_validity(handle, storage_id, scan_data->msg, MS_VALID_V2, MS_RECURSIVE, uid);
else
ms_set_folder_item_validity(handle, storage_id, scan_data->msg, MS_INVALID, MS_RECURSIVE, uid);
+
+ msc_send_result_partial(ret, MS_MSG_RECURSIVE_START, scan_data->pid, scan_data->msg);
}
} else {
MS_DBG_WARN("start non recursive dir scan!!");
/* send result message */
memset(&send_msg, 0x0, sizeof(ms_comm_msg_s));
- send_msg.msg_type = MS_MSG_SCANNER_PARTIAL;
+ send_msg.msg_type = msg_type;
send_msg.pid = pid;
send_msg.result = result;
SAFE_STRLCPY(send_msg.msg, msg, sizeof(send_msg.msg));
data = g_array_index(owner_list, ms_req_owner_data*, i);
if (data->pid == pid && strcmp(data->req_path, recv_msg->msg) == 0) {
ms_ipc_send_msg_to_client_tcp(data->client_sockfd, recv_msg, NULL);
- if (recv_msg->msg_type != MS_MSG_SCANNER_COMPLETE)
+ if (recv_msg->msg_type != MS_MSG_SCANNER_COMPLETE && recv_msg->msg_type != MS_MSG_RECURSIVE_START)
g_array_remove_index(owner_list, i);
break;
break;
case MS_MSG_SCANNER_PARTIAL:
case MS_MSG_SCANNER_COMPLETE:
+ case MS_MSG_RECURSIVE_START:
MS_DBG_WARN("DB UPDATING IS DONE[%d]", recv_msg.msg_type);
break;
default: