- int len = 0;
- media_folder_s *_folder = (media_folder_s*)folder;
-
- char sql[MAX_QUERY_SIZE];
- memset(sql, '\0', sizeof(sql));
- char *set_sql = NULL;
- char *where_sql = NULL;
-
- if((_folder != NULL) && STRING_VALID(_folder->folder_id) && g_src_path)
- {
- /* Set modified time */
- time_t date;
- time(&date);
- _folder->modified_time = date;
-
- set_sql = __media_folder_get_update_folder_sql((media_folder_h)_folder);
- if(set_sql == NULL)
- {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
-
- where_sql = sqlite3_mprintf("folder_uuid='%q'", _folder->folder_id);
-
- len = snprintf(sql, sizeof(sql), UPDATE_SQL, DB_TABLE_FOLDER, set_sql, where_sql);
- if (len > 0) {
- sql[len] = '\0';
- } else {
- media_content_error("snprintf failed");
- return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
- }
-
- ret = _content_query_sql(sql);
-
- sqlite3_free(set_sql);
- sqlite3_free(where_sql);
-
- /* Do folder rename operation using libmedia-service */
- ret = media_svc_rename_folder(_content_get_db_handle(), g_src_path, _folder->path, tzplatform_getuid(TZ_USER_NAME));
- return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
- }
- else
- {
- media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
- ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ int status = MEDIA_DIR_SCAN_NONE;
+
+ content_retip_if_fail(STRING_VALID(storage_uuid));
+ content_retip_if_fail(STRING_VALID(path));
+ content_retip_if_fail(scan_status);
+
+ ret = media_svc_get_folder_scan_status(_content_get_db_handle(), storage_uuid, path, &status);
+ if (ret != MS_MEDIA_ERR_NONE) {
+ content_error("media_svc_get_folder_scan_status failed");
+ ret = _content_error_capi(ret);
+ } else {
+ *scan_status = status;