4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
22 #include <media-util.h>
23 #include "media-svc.h"
24 #include "media-svc-util.h"
26 int insert_item_begin(bool with_noti, int from_pid)
28 return media_svc_insert_item_begin(with_noti, from_pid);
31 int insert_item_end(uid_t uid)
33 return media_svc_insert_item_end(uid);
36 int insert_item(sqlite3 *handle, const char *storage_id, const char *file_path, uid_t uid)
38 return media_svc_insert_item_bulk(handle, storage_id, file_path, uid);
41 int set_item_validity(const char *storage_id, const char *file_path, int validity, uid_t uid)
43 return media_svc_set_item_validity(file_path, validity, uid);
46 int send_dir_update_noti(const char *dir_path, const char *folder_id, int update_type, int pid)
48 return media_svc_send_dir_update_noti(dir_path, folder_id, (media_item_update_type_e)update_type, pid);
51 int check_db(sqlite3 *handle, uid_t uid)
53 int ret = MS_MEDIA_ERR_NONE;
56 ret = media_svc_check_table_exist(handle, &exist);
57 if (ret != MS_MEDIA_ERR_NONE)
61 ret = media_svc_create_table(uid);
66 int check_storage(sqlite3 *handle, const char *storage_id, char **storage_path, int *validity, uid_t uid)
68 return media_svc_check_storage(handle, storage_id, storage_path, validity);
71 int insert_storage(sqlite3 *handle, const char *storage_id, const char *storage_path, uid_t uid)
73 return media_svc_insert_storage(handle, storage_id, storage_path, uid);
76 int update_storage(sqlite3 *handle, const char *storage_id, const char *storage_path, uid_t uid)
78 return media_svc_update_storage(handle, storage_id, storage_path, uid);
81 int set_storage_validity(sqlite3 *handle, const char *storage_id, int validity, uid_t uid)
83 return media_svc_set_storage_validity(storage_id, validity, uid);
86 int set_all_storage_validity(sqlite3 *handle, int validity, uid_t uid)
88 return media_svc_set_storage_validity(NULL, validity, uid);
91 int get_storage_id(sqlite3 *handle, const char *path, char *storage_id, uid_t uid)
93 return media_svc_get_storage_id(handle, path, storage_id, uid);
96 int insert_folder(sqlite3 *handle, const char *storage_id, const char *file_path, uid_t uid)
98 return media_svc_insert_folder(handle, storage_id, file_path, uid);
101 int set_folder_validity(sqlite3 *handle, const char *storage_id, const char *start_path, int validity, bool is_recursive, uid_t uid)
103 return media_svc_set_folder_validity(start_path, validity, is_recursive, uid);
106 int check_folder_exist(sqlite3 *handle, const char *storage_id, const char *folder_path)
108 return media_svc_check_folder_exist_by_path(handle, folder_path);
111 int get_media_type(const char *path, int *mediatype)
113 return media_svc_get_media_type(path, mediatype);
116 int refresh_item(sqlite3 *handle, const char *storage_id, const char *path, uid_t uid)
118 return media_svc_refresh_item(handle, true, storage_id, path, uid);