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.
24 #include <media-util.h>
25 #include "media-svc.h"
26 #include "media-svc-util.h"
28 int cleanup_db(sqlite3 *handle, uid_t uid)
31 return MS_MEDIA_ERR_NONE;
34 int insert_item_begin(int item_cnt, bool with_noti, int from_pid)
36 return media_svc_insert_item_begin(with_noti, from_pid);
39 int insert_item_end(uid_t uid)
41 return media_svc_insert_item_end(uid);
44 int insert_item(sqlite3 *handle, const char *storage_id, const char *file_path, int storage_type, uid_t uid)
46 return media_svc_insert_item_bulk(handle, storage_id, storage_type, file_path, uid);
49 int set_item_validity_begin(int item_cnt)
51 /* No more need in v1 */
52 return MS_MEDIA_ERR_NONE;
55 int set_item_validity_end(uid_t uid)
57 /* No more need in v1 */
58 return MS_MEDIA_ERR_NONE;
61 int set_item_validity(const char *storage_id, const char *file_path, int storage_type, int validity, uid_t uid)
63 return media_svc_set_item_validity(file_path, validity, uid);
66 int send_dir_update_noti(const char *dir_path, const char *folder_id, int update_type, int pid)
68 return media_svc_send_dir_update_noti(dir_path, folder_id, (media_item_update_type_e)update_type, pid);
71 int check_db(sqlite3 *handle, uid_t uid)
73 int ret = MS_MEDIA_ERR_NONE;
74 int user_version = -1;
76 ret = media_svc_get_user_version(handle, &user_version);
77 if (ret != MS_MEDIA_ERR_NONE)
80 if (user_version == 0)
81 ret = media_svc_create_table(uid);
83 ret = media_svc_check_db_upgrade(handle, user_version, uid);
88 int update_folder_time(sqlite3 *handle, const char *storage_id, char *folder_path, uid_t uid)
91 return MS_MEDIA_ERR_NONE;
94 int get_uuid(char **uuid)
97 return MS_MEDIA_ERR_NONE;
100 int check_storage(sqlite3 *handle, const char *storage_id, char **storage_path, int *validity, uid_t uid)
102 return media_svc_check_storage(handle, storage_id, storage_path, validity);
105 int insert_storage(sqlite3 *handle, const char *storage_id, int storage_type, const char *storage_path, uid_t uid)
107 return media_svc_insert_storage(handle, storage_id, storage_path, storage_type, uid);
110 int update_storage(sqlite3 *handle, const char *storage_id, const char *storage_path, uid_t uid)
112 return media_svc_update_storage(handle, storage_id, storage_path, uid);
115 int set_storage_validity(sqlite3 *handle, const char *storage_id, int validity, uid_t uid)
117 return media_svc_set_storage_validity(handle, storage_id, validity, uid);
120 int set_all_storage_validity(sqlite3 *handle, int validity, uid_t uid)
122 return media_svc_set_storage_validity(handle, NULL, validity, uid);
125 int get_storage_id(sqlite3 *handle, const char *path, char *storage_id, uid_t uid)
127 return media_svc_get_storage_id(handle, path, storage_id, uid);
130 int set_storage_scan_status(sqlite3 *handle, const char *storage_id, int status, uid_t uid)
133 return MS_MEDIA_ERR_NONE;
136 int update_item_meta(sqlite3 *handle, uid_t uid)
138 return media_svc_update_item_meta(handle, uid);
141 int insert_item_scan(sqlite3 *handle, const char *storage_id, const char *file_path, int storage_type, uid_t uid)
144 return MS_MEDIA_ERR_NONE;
147 int get_extract_list(sqlite3* handle, const char* storage_id, int storage_type, int scan_type, const char* path, int burst, uid_t uid, void* array)
150 return MS_MEDIA_ERR_NONE;
153 int update_one_extract_item(sqlite3* handle, const char* storage_id, int storage_type, void* data)
156 return MS_MEDIA_ERR_NONE;
159 int query_do_update_list(sqlite3* handle)
162 return MS_MEDIA_ERR_NONE;
165 int delete_all_invalid_items_in_folder(sqlite3 *handle, const char* storage_id, const char*path, bool is_recursive, uid_t uid)
168 return MS_MEDIA_ERR_NONE;
171 int delete_invalid_folder_by_path(sqlite3 *handle, const char *storage_id, const char *folder_path, uid_t uid)
174 return MS_MEDIA_ERR_NONE;
177 int insert_folder(sqlite3 *handle, const char *storage_id, const char *file_path, int storage_type, uid_t uid)
179 return media_svc_insert_folder(handle, storage_id, storage_type, file_path, uid);
182 int set_folder_validity(sqlite3 *handle, const char *storage_id, const char* start_path, int validity, bool is_recursive, uid_t uid)
184 return media_svc_set_folder_validity(storage_id, start_path, validity, is_recursive, uid);
187 int get_folder_scan_status(sqlite3 *handle, const char *storage_id, const char *path, int *status)
190 return MS_MEDIA_ERR_NONE;
193 int set_folder_scan_status(sqlite3 *handle, const char *storage_id, const char *path, int status, uid_t uid)
196 return MS_MEDIA_ERR_NONE;
199 int check_folder_modified(sqlite3 *handle, const char *path, const char *storage_id, bool *modified)
202 return MS_MEDIA_ERR_NONE;
205 int get_null_scan_folder_list(sqlite3 *handle, const char *storage_id, const char *folder_path, char ***folder_list, int *count)
208 return MS_MEDIA_ERR_NONE;
211 int change_validity_item_batch(sqlite3 *handle, const char *storage_id, const char *path, int des_validity, int src_validity, uid_t uid)
214 return MS_MEDIA_ERR_NONE;
217 int check_folder_exist(sqlite3 *handle, const char *storage_id, const char *folder_path)
219 return media_svc_check_folder_exist_by_path(handle, storage_id, folder_path);
222 int get_media_type(const char *path, int *mediatype)
224 return media_svc_get_media_type(path, mediatype);
227 int refresh_item(sqlite3 *handle, const char *storage_id, const char *path, uid_t uid)
229 int ret = MS_MEDIA_ERR_NONE;
230 ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL;
232 ret = ms_user_get_storage_type(uid, path, &storage_type);
233 if (ret != MS_MEDIA_ERR_NONE)
236 return media_svc_refresh_item(handle, true, storage_id, storage_type, path, uid);