summaryrefslogtreecommitdiff
path: root/plugin/media-content-plugin.c
blob: aa5a420bc24bf96fa2518379a8941ca2a02a8f4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
/*
 * libmedia-service
 *
 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
 *
 * Contact: Hyunjun Ko <zzoon.ko@samsung.com>, Haejeong Kim <backto.kim@samsung.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

#include <string.h>
#include <mm_file.h>
#include <media-util.h>
#include "media-svc.h"
#include "media-svc-util.h"

int cleanup_db(sqlite3 *handle, uid_t uid)
{
	/* For scanner V2 */
	return MS_MEDIA_ERR_NONE;
}

int insert_item_begin(int item_cnt, int with_noti, int from_pid)
{
	return media_svc_insert_item_begin(item_cnt, with_noti, from_pid);
}

int insert_item_end(uid_t uid)
{
	return media_svc_insert_item_end(uid);
}

int insert_item(sqlite3 *handle, const char *storage_id, const char *file_path, int storage_type, uid_t uid)
{
	return media_svc_insert_item_bulk(handle, storage_id, storage_type, file_path, uid);
}

int set_item_validity_begin(int item_cnt)
{
	return media_svc_set_item_validity_begin(item_cnt);
}

int set_item_validity_end(uid_t uid)
{
	return media_svc_set_item_validity_end(uid);
}

int set_item_validity(const char *storage_id, const char *file_path, int storage_type, int validity, uid_t uid)
{
	return media_svc_set_item_validity(storage_id, file_path, validity, uid);
}

int delete_item(sqlite3 *handle, const char *storage_id, const char *file_path, uid_t uid)
{
	return media_svc_delete_item_by_path(handle, storage_id, file_path, uid);
}

int send_dir_update_noti(sqlite3 *handle, const char *storage_id, const char *dir_path, const char *folder_id, int update_type, int pid)
{
	return media_svc_send_dir_update_noti(handle, storage_id, dir_path, folder_id, (media_item_update_type_e)update_type, pid);
}

int check_db(sqlite3 *handle, uid_t uid)
{
	int ret = MS_MEDIA_ERR_NONE;
	int user_version = -1;

	ret = media_svc_get_user_version(handle, &user_version);
	if (ret != MS_MEDIA_ERR_NONE)
		return ret;

	if (user_version == 0)
		ret = media_svc_create_table(uid);
	else
		ret = media_svc_check_db_upgrade(handle, user_version, uid);

	return ret;
}

int update_folder_time(sqlite3 *handle, const char *storage_id, char *folder_path, uid_t uid)
{
	/* For scanner V2 */
	return MS_MEDIA_ERR_NONE;
}

int get_uuid(char **uuid)
{
	return media_svc_generate_uuid(uuid);
}

int check_storage(sqlite3 *handle, const char *storage_id, char **storage_path, int *validity, uid_t uid)
{
	return media_svc_check_storage(handle, storage_id, storage_path, validity, uid);
}

int insert_storage(sqlite3 *handle, const char *storage_id, int storage_type, const char *storage_path, uid_t uid)
{
	return media_svc_insert_storage(handle, storage_id, storage_path, storage_type, uid);
}

int update_storage(sqlite3 *handle, const char *storage_id, const char *storage_path, uid_t uid)
{
	return media_svc_update_storage(handle, storage_id, storage_path, uid);
}

int set_storage_validity(sqlite3 *handle, const char *storage_id, int validity, uid_t uid)
{
	return media_svc_set_storage_validity(handle, storage_id, validity, uid);
}

int set_all_storage_validity(sqlite3 *handle, int validity, uid_t uid)
{
	return media_svc_set_storage_validity(handle, NULL, validity, uid);
}

int get_storage_id(sqlite3 *handle, const char *path, char *storage_id, uid_t uid)
{
	return media_svc_get_storage_id(handle, path, storage_id, uid);
}

int set_storage_scan_status(sqlite3 *handle, const char *storage_id, int status, uid_t uid)
{
	/* For scanner V2 */
	return MS_MEDIA_ERR_NONE;
}

int update_item_begin(int item_cnt)
{
	return media_svc_update_item_begin(item_cnt);
}

int update_item_end(uid_t uid)
{
	return media_svc_update_item_end(uid);
}

int update_item_meta(const char *file_path, const char *storage_id, int storage_type, uid_t uid)
{
	return media_svc_update_item_meta(file_path, storage_id, storage_type, uid);
}

int insert_item_scan(sqlite3 *handle, const char *storage_id, const char *file_path, int storage_type, uid_t uid)
{
	/* For scanner V2 */
	return MS_MEDIA_ERR_NONE;
}

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)
{
	/* For scanner V2 */
	return MS_MEDIA_ERR_NONE;
}

int update_one_extract_item(sqlite3* handle, const char* storage_id, int storage_type, void* data)
{
	/* For scanner V2 */
	return MS_MEDIA_ERR_NONE;
}

int query_do_update_list(sqlite3* handle)
{
	/* For scanner V2 */
	return MS_MEDIA_ERR_NONE;
}

int delete_all_invalid_items_in_folder(sqlite3 *handle, const char* storage_id, const char*path, bool is_recursive, uid_t uid)
{
	/* For scanner V2 */
	return MS_MEDIA_ERR_NONE;
}

int delete_invalid_folder_by_path(sqlite3 *handle, const char *storage_id, const char *folder_path, uid_t uid)
{
	/* For scanner V2 */
	return MS_MEDIA_ERR_NONE;
}

int insert_folder_begin(int item_cnt)
{
	return media_svc_insert_folder_begin(item_cnt);
}

int insert_folder_end(uid_t uid)
{
	return media_svc_insert_folder_end(uid);
}

int insert_folder(sqlite3 *handle, const char *storage_id, const char *file_path, int storage_type, uid_t uid)
{
	return media_svc_insert_folder(handle, storage_id, storage_type, file_path, uid);
}

int set_folder_validity(sqlite3 *handle, const char *storage_id, const char* start_path, int validity, bool is_recursive, uid_t uid)
{
	return media_svc_set_folder_validity(handle, storage_id, start_path, validity, is_recursive, uid);
}

int get_folder_scan_status(sqlite3 *handle, const char *storage_id, const char *path, int *status)
{
	/* For scanner V2 */
	return MS_MEDIA_ERR_NONE;
}

int set_folder_scan_status(sqlite3 *handle, const char *storage_id, const char *path, int status, uid_t uid)
{
	/* For scanner V2 */
	return MS_MEDIA_ERR_NONE;
}

int check_folder_modified(sqlite3 *handle, const char *path, const char *storage_id, bool *modified)
{
	/* For scanner V2 */
	return MS_MEDIA_ERR_NONE;
}

int get_null_scan_folder_list(sqlite3 *handle, const char *storage_id, const char *folder_path, char ***folder_list, int *count)
{
	/* For scanner V2 */
	return MS_MEDIA_ERR_NONE;
}

int change_validity_item_batch(sqlite3 *handle, const char *storage_id, const char *path, int des_validity, int src_validity, uid_t uid)
{
	/* For scanner V2 */
	return MS_MEDIA_ERR_NONE;
}

int check_folder_exist(sqlite3 *handle, const char *storage_id, const char *folder_path)
{
	return media_svc_check_folder_exist_by_path(handle, storage_id, folder_path);
}

int get_media_type(const char *path, int *mediatype)
{
	return media_svc_get_media_type(path, mediatype);
}