4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hyunjun Ko <zzoon.ko@samsung.com>, Haejeong Kim <backto.kim@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #include <glib/gstdio.h>
23 #include <media-util-err.h>
24 #include "media-svc-media-folder.h"
25 #include "media-svc-debug.h"
26 #include "media-svc-env.h"
27 #include "media-svc-util.h"
28 #include "media-svc-db-utils.h"
30 extern __thread GList *g_media_svc_move_item_query_list;
31 static __thread GList *g_media_svc_insert_folder_query_list;
33 static int __media_svc_is_root_path(const char *folder_path, bool *is_root)
35 media_svc_retvm_if(!STRING_VALID(folder_path), MS_MEDIA_ERR_INVALID_PARAMETER, "folder_path is NULL");
39 if (strcmp(folder_path, MEDIA_ROOT_PATH_INTERNAL) == 0 ||
40 strcmp(folder_path, MEDIA_ROOT_PATH_SDCARD) == 0 ||
41 strcmp(folder_path, MEDIA_ROOT_PATH_CLOUD) == 0) {
42 media_svc_debug("ROOT PATH [%d]", folder_path);
46 return MS_MEDIA_ERR_NONE;
49 static int __media_svc_parent_is_ext_root_path(const char *folder_path, bool *is_root)
51 char *parent_folder_path = NULL;
53 media_svc_retvm_if(!STRING_VALID(folder_path), MS_MEDIA_ERR_INVALID_PARAMETER, "folder_path is NULL");
57 parent_folder_path = g_path_get_dirname(folder_path);
59 if(!STRING_VALID(parent_folder_path)) {
60 media_svc_error("error : g_path_get_dirname falied");
61 SAFE_FREE(parent_folder_path);
62 return MS_MEDIA_ERR_OUT_OF_MEMORY;
65 if (strcmp(parent_folder_path, MEDIA_ROOT_PATH_EXTERNAL) == 0) {
66 media_svc_debug("parent folder is ROOT PATH [%s]", parent_folder_path);
70 SAFE_FREE(parent_folder_path);
72 return MS_MEDIA_ERR_NONE;
75 int _media_svc_get_folder_id_by_foldername(sqlite3 *handle, const char *storage_id, const char *folder_name, char *folder_id, uid_t uid)
77 int ret = MS_MEDIA_ERR_NONE;
78 sqlite3_stmt *sql_stmt = NULL;
80 char parent_folder_uuid[MEDIA_SVC_UUID_SIZE+1] = {0, };
81 char *temp_parent_uuid = NULL;
82 char *parent_folder_path = NULL;
84 sql = sqlite3_mprintf("SELECT folder_uuid, parent_folder_uuid FROM '%s' WHERE storage_uuid = '%q' AND path = '%q';", MEDIA_SVC_DB_TABLE_FOLDER, storage_id, folder_name);
86 ret = _media_svc_sql_prepare_to_step(handle, sql, &sql_stmt);
88 if (ret != MS_MEDIA_ERR_NONE) {
89 if (ret == MS_MEDIA_ERR_DB_NO_RECORD) {
90 media_svc_debug("there is no folder.");
92 media_svc_error("error when _media_svc_get_folder_id_by_foldername. err = [%d]", ret);
97 memset(parent_folder_uuid, 0, sizeof(parent_folder_uuid));
99 _strncpy_safe(folder_id, (const char *)sqlite3_column_text(sql_stmt, 0), MEDIA_SVC_UUID_SIZE + 1);
100 if (STRING_VALID((const char *)sqlite3_column_text(sql_stmt, 1))) /*root path can be null*/
101 _strncpy_safe(parent_folder_uuid, (const char *)sqlite3_column_text(sql_stmt, 1), MEDIA_SVC_UUID_SIZE+1);
103 SQLITE3_FINALIZE(sql_stmt);
105 /*root path can be null*/
106 if(!STRING_VALID(parent_folder_uuid)) {
107 bool is_root = FALSE;
109 ret = __media_svc_is_root_path(folder_name, &is_root);
111 return MS_MEDIA_ERR_NONE;
113 ret = __media_svc_parent_is_ext_root_path(folder_name, &is_root);
115 return MS_MEDIA_ERR_NONE;
118 /* Notice : Below code is the code only for inserting parent folder uuid when upgrade the media db version 3 to 4 */
119 /* Check parent folder uuid */
120 if(!STRING_VALID(parent_folder_uuid)) {
121 /* update parent_uuid */
122 media_svc_error("[No-Error] there is no parent folder uuid. PLEASE CHECK IT");
124 parent_folder_path = g_path_get_dirname(folder_name);
125 if(!STRING_VALID(parent_folder_path)) {
126 media_svc_error("error : g_path_get_dirname falied.");
127 return MS_MEDIA_ERR_OUT_OF_MEMORY;
130 if(STRING_VALID(storage_id))
131 sql = sqlite3_mprintf("SELECT folder_uuid FROM '%s' WHERE storage_uuid = '%q' AND path = '%q';", MEDIA_SVC_DB_TABLE_FOLDER, storage_id, parent_folder_path);
133 sql = sqlite3_mprintf("SELECT folder_uuid FROM '%s' WHERE path = '%q';", MEDIA_SVC_DB_TABLE_FOLDER, parent_folder_path);
135 SAFE_FREE(parent_folder_path);
137 ret = _media_svc_sql_prepare_to_step(handle, sql, &sql_stmt);
138 if (ret == MS_MEDIA_ERR_NONE) {
139 temp_parent_uuid = (char *)sqlite3_column_text(sql_stmt, 0);
140 if (temp_parent_uuid != NULL) {
141 _strncpy_safe(parent_folder_uuid, temp_parent_uuid, MEDIA_SVC_UUID_SIZE+1);
144 SQLITE3_FINALIZE(sql_stmt);
147 if(STRING_VALID(parent_folder_uuid)) {
148 if(STRING_VALID(storage_id))
149 sql = sqlite3_mprintf("UPDATE %q SET parent_folder_uuid = '%q' WHERE storage_uuid = '%q' AND path = '%q';", MEDIA_SVC_DB_TABLE_FOLDER, parent_folder_uuid, storage_id, folder_name);
151 sql = sqlite3_mprintf("UPDATE %q SET parent_folder_uuid = '%q' WHERE path = '%q';", MEDIA_SVC_DB_TABLE_FOLDER, parent_folder_uuid, folder_name);
152 ret = _media_svc_sql_query(handle, sql, uid);
155 media_svc_error("error when get parent folder uuid");
162 static int __media_svc_append_folder(sqlite3 *handle, const char *storage_id, media_svc_storage_type_e storage_type,
163 const char *folder_id, const char *folder_path, const char *parent_folder_uuid, bool stack_query, uid_t uid)
165 int ret = MS_MEDIA_ERR_NONE;
166 char *folder_name = NULL;
167 int folder_modified_date = 0;
169 folder_name = g_path_get_basename(folder_path);
170 folder_modified_date = _media_svc_get_file_time(folder_path);
172 /*Update Pinyin If Support Pinyin*/
173 char *folder_name_pinyin = NULL;
174 if (_media_svc_check_pinyin_support())
175 _media_svc_get_pinyin_str(folder_name, &folder_name_pinyin);
177 char *sql = sqlite3_mprintf("INSERT INTO %s (folder_uuid, path, name, storage_uuid, storage_type, modified_time, name_pinyin, parent_folder_uuid) \
178 values (%Q, %Q, %Q, %Q, '%d', '%d', %Q, %Q); ",
179 MEDIA_SVC_DB_TABLE_FOLDER, folder_id, folder_path, folder_name, storage_id, storage_type, folder_modified_date, folder_name_pinyin, parent_folder_uuid);
183 ret = _media_svc_sql_query(handle, sql, uid);
188 _media_svc_sql_query_add(&g_media_svc_insert_folder_query_list, &sql);
191 SAFE_FREE(folder_name);
192 SAFE_FREE(folder_name_pinyin);
197 int _media_svc_update_folder_modified_time_by_folder_uuid(sqlite3 *handle, const char *folder_uuid, const char *folder_path, bool stack_query, uid_t uid)
199 int ret = MS_MEDIA_ERR_NONE;
200 int modified_time = 0;
202 modified_time = _media_svc_get_file_time(folder_path);
204 char *sql = sqlite3_mprintf("UPDATE %s SET modified_time=%d WHERE folder_uuid=%Q;", MEDIA_SVC_DB_TABLE_FOLDER, modified_time, folder_uuid);
207 ret = _media_svc_sql_query(handle, sql, uid);
210 _media_svc_sql_query_add(&g_media_svc_move_item_query_list, &sql);
216 static int __media_svc_get_and_append_parent_folder(sqlite3 *handle, const char *storage_id, const char *path, media_svc_storage_type_e storage_type, char *folder_id, uid_t uid)
218 int ret = MS_MEDIA_ERR_NONE;
219 unsigned int next_pos = 0;
221 char *dir_path = NULL;
222 const char *token = "/";
223 char *folder_uuid = NULL;
224 char parent_folder_uuid[MEDIA_SVC_UUID_SIZE + 1] = {0, };
225 bool folder_search_end = FALSE;
227 memset(parent_folder_uuid, 0, sizeof(parent_folder_uuid));
229 if (strncmp(path, _media_svc_get_path(uid), strlen(_media_svc_get_path(uid))) == 0)
230 next_pos = strlen(_media_svc_get_path(uid));
231 else if (strncmp(path, MEDIA_ROOT_PATH_SDCARD, strlen(MEDIA_ROOT_PATH_SDCARD)) == 0)
232 next_pos = strlen(MEDIA_ROOT_PATH_SDCARD);
233 else if (strncmp(path, MEDIA_ROOT_PATH_CLOUD, strlen(MEDIA_ROOT_PATH_CLOUD)) == 0)
234 next_pos = strlen(MEDIA_ROOT_PATH_CLOUD);
235 else if (strncmp(path, MEDIA_ROOT_PATH_EXTERNAL, strlen(MEDIA_ROOT_PATH_EXTERNAL)) == 0)
236 next_pos = strlen(MEDIA_ROOT_PATH_EXTERNAL);
238 media_svc_error("Invalid Path");
239 return MS_MEDIA_ERR_INTERNAL;
242 while (!folder_search_end) {
243 next = strstr(path + next_pos, token);
245 next_pos = (next - path);
246 dir_path = strndup(path, next_pos);
249 media_svc_error("End Path");
250 dir_path = strndup(path, strlen(path));
251 folder_search_end = TRUE;
252 media_svc_error("[No-Error] End Path [%s]", dir_path);
255 if (strcmp(dir_path, MEDIA_ROOT_PATH_EXTERNAL) == 0) {
256 /*To avoid insert MEDIA_ROOT_PATH_EXTERNAL path*/
260 ret = _media_svc_get_folder_id_by_foldername(handle, storage_id, dir_path, parent_folder_uuid, uid);
261 if (ret == MS_MEDIA_ERR_DB_NO_RECORD) {
262 media_svc_error("NOT EXIST dir path : %s", dir_path);
264 folder_uuid = _media_info_generate_uuid();
265 if (folder_uuid == NULL) {
266 media_svc_error("Invalid UUID");
268 return MS_MEDIA_ERR_INTERNAL;
271 ret = __media_svc_append_folder(handle, storage_id, storage_type, folder_uuid, dir_path, parent_folder_uuid, FALSE, uid);
272 if (ret != MS_MEDIA_ERR_NONE) {
273 media_svc_error("__media_svc_append_folder is failed");
276 _strncpy_safe(parent_folder_uuid, folder_uuid, MEDIA_SVC_UUID_SIZE + 1);
278 media_svc_error("EXIST dir path : %s\n", dir_path);
284 if(STRING_VALID(folder_uuid)) {
285 _strncpy_safe(folder_id, folder_uuid, MEDIA_SVC_UUID_SIZE + 1);
287 media_svc_error("Fail to get folder_uuid");
288 return MS_MEDIA_ERR_INTERNAL;
291 return MS_MEDIA_ERR_NONE;
294 int _media_svc_get_and_append_folder(sqlite3 *handle, const char *storage_id, const char *path, media_svc_storage_type_e storage_type, char *folder_id, uid_t uid)
296 int ret = MS_MEDIA_ERR_NONE;
298 ret = _media_svc_get_folder_id_by_foldername(handle, storage_id, path, folder_id, uid);
300 if (ret == MS_MEDIA_ERR_DB_NO_RECORD) {
301 ret = __media_svc_get_and_append_parent_folder(handle, storage_id, path, storage_type, folder_id, uid);
307 int _media_svc_get_and_append_folder_id_by_path(sqlite3 *handle, const char *storage_id, const char *path, media_svc_storage_type_e storage_type, char *folder_id, uid_t uid)
309 char *path_name = NULL;
310 int ret = MS_MEDIA_ERR_NONE;
312 path_name = g_path_get_dirname(path);
314 ret = _media_svc_get_and_append_folder(handle, storage_id, path_name, storage_type, folder_id, uid);
316 SAFE_FREE(path_name);
321 int _media_svc_update_folder_table(sqlite3 *handle, const char *storage_id, uid_t uid)
323 int ret = MS_MEDIA_ERR_NONE;
326 sql = sqlite3_mprintf("DELETE FROM '%s' WHERE folder_uuid IN (SELECT folder_uuid FROM '%s' WHERE folder_uuid NOT IN (SELECT folder_uuid FROM '%s'))",
327 MEDIA_SVC_DB_TABLE_FOLDER, MEDIA_SVC_DB_TABLE_FOLDER, storage_id);
329 ret = _media_svc_sql_query(handle, sql, uid);
335 static int __media_svc_count_all_folders(sqlite3 *handle, char *start_path, int *count)
337 int ret = MS_MEDIA_ERR_NONE;
338 sqlite3_stmt *sql_stmt = NULL;
339 char *sql = sqlite3_mprintf("SELECT count(*) FROM '%s' WHERE path LIKE '%q%%'", MEDIA_SVC_DB_TABLE_FOLDER, start_path);
341 ret = _media_svc_sql_prepare_to_step(handle, sql, &sql_stmt);
342 if (ret != MS_MEDIA_ERR_NONE) {
343 media_svc_error("error when _media_svc_sql_prepare_to_step. err = [%d]", ret);
347 *count = sqlite3_column_int(sql_stmt, 0);
349 SQLITE3_FINALIZE(sql_stmt);
351 return MS_MEDIA_ERR_NONE;
354 int _media_svc_get_all_folders(sqlite3 *handle, char *start_path, char ***folder_list, time_t **modified_time_list, int **item_num_list, int *count)
356 int ret = MS_MEDIA_ERR_NONE;
358 sqlite3_stmt *sql_stmt = NULL;
361 char **folder_uuid = NULL;
364 ret = __media_svc_count_all_folders(handle, start_path, &cnt);
365 if (ret != MS_MEDIA_ERR_NONE) {
366 media_svc_error("error when __media_svc_count_all_folders. err = [%d]", ret);
371 sql = sqlite3_mprintf("SELECT path, modified_time, folder_uuid FROM '%s' WHERE path LIKE '%q%%'", MEDIA_SVC_DB_TABLE_FOLDER, start_path);
374 *modified_time_list = NULL;
375 *item_num_list = NULL;
376 return MS_MEDIA_ERR_NONE;
379 *folder_list = malloc(sizeof(char *) * cnt);
380 *modified_time_list = malloc(sizeof(int) * cnt);
381 *item_num_list = malloc(sizeof(int) * cnt);
382 folder_uuid = malloc(sizeof(char *) * cnt);
384 if ((*folder_list == NULL) || (*modified_time_list == NULL) || (*item_num_list == NULL) || (folder_uuid == NULL)) {
385 media_svc_error("Out of memory");
388 memset(folder_uuid, 0x0, sizeof(char *) * cnt);
390 ret = _media_svc_sql_prepare_to_step(handle, sql, &sql_stmt);
391 if (ret != MS_MEDIA_ERR_NONE) {
392 media_svc_error("prepare error [%s]", sqlite3_errmsg(handle));
396 media_svc_debug("QEURY OK");
399 if (STRING_VALID((char *)sqlite3_column_text(sql_stmt, 0)))
400 (*folder_list)[idx] = strdup((char *)sqlite3_column_text(sql_stmt, 0));
402 (*modified_time_list)[idx] = (int)sqlite3_column_int(sql_stmt, 1);
404 /* get the folder's id */
405 if (STRING_VALID((char *)sqlite3_column_text(sql_stmt, 2)))
406 folder_uuid[idx] = strdup((char *)sqlite3_column_text(sql_stmt, 2));
410 if (sqlite3_step(sql_stmt) != SQLITE_ROW)
413 SQLITE3_FINALIZE(sql_stmt);
415 /*get the numbder of item in the folder by using folder's id */
416 for (i = 0; i < idx; i++) {
417 if (STRING_VALID(folder_uuid[i])) {
418 sql = sqlite3_mprintf("SELECT COUNT(*) FROM %s WHERE (folder_uuid='%q' AND validity = 1)", MEDIA_SVC_DB_TABLE_MEDIA, folder_uuid[i]);
419 ret = _media_svc_sql_prepare_to_step(handle, sql, &sql_stmt);
420 if (ret != MS_MEDIA_ERR_NONE) {
421 media_svc_error("prepare error [%s]", sqlite3_errmsg(handle));
425 (*item_num_list)[i] = (int)sqlite3_column_int(sql_stmt, 0);
427 SQLITE3_FINALIZE(sql_stmt);
429 media_svc_error("Invalid Folder Id");
435 media_svc_debug("Get Folder is OK");
437 media_svc_error("Fail to get folder");
438 ret = MS_MEDIA_ERR_INTERNAL;
443 for (i = 0; i < idx; i++) {
444 SAFE_FREE(folder_uuid[i]);
446 SAFE_FREE(folder_uuid);
453 for (i = 0; i < idx; i++) {
454 SAFE_FREE((*folder_list)[i]);
455 SAFE_FREE(folder_uuid[i]);
457 SAFE_FREE(*folder_list);
458 SAFE_FREE(*modified_time_list);
459 SAFE_FREE(*item_num_list);
460 SAFE_FREE(folder_uuid);
467 int _media_svc_get_folder_info_by_foldername(sqlite3 *handle, const char *folder_name, char *folder_id, time_t *modified_time)
469 int ret = MS_MEDIA_ERR_NONE;
470 sqlite3_stmt *sql_stmt = NULL;
472 char *sql = sqlite3_mprintf("SELECT folder_uuid, modified_time FROM %s WHERE path = '%q';", MEDIA_SVC_DB_TABLE_FOLDER, folder_name);
474 ret = _media_svc_sql_prepare_to_step(handle, sql, &sql_stmt);
476 if (ret != MS_MEDIA_ERR_NONE) {
477 if (ret == MS_MEDIA_ERR_DB_NO_RECORD) {
478 media_svc_debug("there is no folder.");
480 media_svc_error("error when _media_svc_get_folder_id_by_foldername. err = [%d]", ret);
485 _strncpy_safe(folder_id, (const char *)sqlite3_column_text(sql_stmt, 0), MEDIA_SVC_UUID_SIZE + 1);
486 *modified_time = (int)sqlite3_column_int(sql_stmt, 1);
488 SQLITE3_FINALIZE(sql_stmt);
493 int _media_svc_get_and_append_folder_id_by_folder_path(sqlite3 *handle, const char *storage_id, const char *path, media_svc_storage_type_e storage_type, char *folder_id, bool stack_query, uid_t uid)
495 char *path_name = NULL;
496 int ret = MS_MEDIA_ERR_NONE;
499 path_name = strdup(path);
500 if (path_name == NULL) {
501 media_svc_error("out of memory");
502 return MS_MEDIA_ERR_OUT_OF_MEMORY;
505 ret = _media_svc_get_folder_id_by_foldername(handle, storage_id, path_name, folder_id, uid);
506 if (ret == MS_MEDIA_ERR_DB_NO_RECORD) {
507 bool is_root = FALSE;
508 bool is_parent_root = FALSE;
510 ret = __media_svc_is_root_path(path_name, &is_root);
511 ret = __media_svc_parent_is_ext_root_path(path_name, &is_parent_root);
513 char parent_folder_uuid[MEDIA_SVC_UUID_SIZE+1] = {0, };
514 memset(parent_folder_uuid, 0x00, sizeof(parent_folder_uuid));
516 if ((is_root == FALSE) && (is_parent_root == FALSE)) {
517 /*get parent folder id*/
518 char *parent_path_name = g_path_get_dirname(path_name);
520 ret = _media_svc_get_folder_id_by_foldername(handle, storage_id, parent_path_name, parent_folder_uuid, uid);
521 if (ret != MS_MEDIA_ERR_NONE) {
522 if (ret == MS_MEDIA_ERR_DB_NO_RECORD) {
523 /*if No-Root directory scanning start before doing storage scanning, parent_folder_uuid can be NULL.
524 You can remove above logic if use below logic always. but I keep above code for the performance issue.
525 Most case (except No-Root directory scanning start before doing storage scanning) get parent_folder_uuid well*/
526 media_svc_error("[No-Error] There is no proper parent_folder_uuid. so try to make it");
527 ret = _media_svc_get_and_append_folder(handle, storage_id, path, storage_type, folder_id, uid);
529 media_svc_error("error when _media_svc_get_parent_folder_id_by_foldername. err = [%d]", ret);
532 SAFE_FREE(path_name);
533 SAFE_FREE(parent_path_name);
539 char *folder_uuid = _media_info_generate_uuid();
540 if (folder_uuid == NULL) {
541 media_svc_error("Invalid UUID");
542 SAFE_FREE(path_name);
543 return MS_MEDIA_ERR_INTERNAL;
546 ret = __media_svc_append_folder(handle, storage_id, storage_type, folder_uuid, path_name, parent_folder_uuid, stack_query, uid);
548 _strncpy_safe(folder_id, folder_uuid, MEDIA_SVC_UUID_SIZE+1);
551 sql = sqlite3_mprintf("UPDATE '%s' SET validity=1 WHERE storage_uuid = '%q' AND path = '%q'", MEDIA_SVC_DB_TABLE_FOLDER, storage_id, path);
555 ret = _media_svc_sql_query(handle, sql, uid);
560 _media_svc_sql_query_add(&g_media_svc_insert_folder_query_list, &sql);
564 SAFE_FREE(path_name);
569 int _media_svc_delete_invalid_folder(sqlite3 *handle, const char *storage_id, uid_t uid)
571 int ret = MS_MEDIA_ERR_NONE;
574 sql = sqlite3_mprintf("DELETE FROM '%s' WHERE storage_uuid = '%q' AND validity = 0", MEDIA_SVC_DB_TABLE_FOLDER, storage_id);
575 ret = _media_svc_sql_query(handle, sql, uid);
582 int _media_svc_set_folder_validity(sqlite3 *handle, const char *storage_id, const char *start_path, int validity, bool is_recursive, uid_t uid)
584 int ret = MS_MEDIA_ERR_NONE;
585 char start_path_id[MEDIA_SVC_UUID_SIZE+1] = {0,};
589 sql = sqlite3_mprintf("UPDATE '%s' SET validity = %d WHERE storage_uuid = '%q' AND path LIKE '%q%%'", MEDIA_SVC_DB_TABLE_FOLDER, validity, storage_id, start_path);
591 ret = _media_svc_get_folder_id_by_foldername(handle, storage_id, start_path, start_path_id, uid);
592 media_svc_retvm_if(ret != MS_MEDIA_ERR_NONE, ret, "_media_svc_get_folder_id_by_foldername fail");
593 media_svc_retvm_if(!STRING_VALID(start_path_id), MS_MEDIA_ERR_INVALID_PARAMETER, "start_path_id is NULL");
595 sql = sqlite3_mprintf("UPDATE '%s' SET validity = %d WHERE storage_uuid = '%q' AND parent_folder_uuid = '%q'", MEDIA_SVC_DB_TABLE_FOLDER, validity, storage_id, start_path_id);
598 ret = _media_svc_sql_query(handle, sql, uid);
605 int _media_svc_delete_folder_by_storage_id(sqlite3 *handle, const char *storage_id, media_svc_storage_type_e storage_type, uid_t uid)
607 int ret = MS_MEDIA_ERR_NONE;
610 sql = sqlite3_mprintf("DELETE FROM '%s' WHERE storage_uuid = '%q' AND storage_type = %d", MEDIA_SVC_DB_TABLE_FOLDER, storage_id, storage_type);
611 ret = _media_svc_sql_query(handle, sql, uid);
618 GList ** _media_svc_get_folder_list_ptr(void)
620 return &g_media_svc_insert_folder_query_list;