return MEDIA_SVC_PLUGIN_ERROR;
}
-int delete_all_items_in_storage(void *handle, const char *storage_id, int storage_type, uid_t uid, char **err_msg)
-{
- int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
-
- if (!STORAGE_VALID(storage_type)) {
- __set_error_message(ERR_STORAGE_TYPE, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- ret = media_svc_delete_all_items_in_storage(storage_id, storage_type, uid);
- if (ret < 0) {
- __set_error_message(ret, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- return MEDIA_SVC_PLUGIN_ERROR_NONE;
-}
-
int delete_all_invalid_items_in_storage(void *handle, const char *storage_id, int storage_type, uid_t uid, char **err_msg)
{
int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
int update_folder_time(void *handle, const char *storage_id, char *folder_path, uid_t uid, char **err_msg)
{
- int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
-
- if (handle == NULL) {
- __set_error_message(ERR_HANDLE, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- if (folder_path == NULL) {
- __set_error_message(ERR_HANDLE, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- ret = media_svc_update_folder_time(handle, storage_id, folder_path, uid);
- if (ret < 0) {
- __set_error_message(ret, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
+ /* For scanner V2 */
return MEDIA_SVC_PLUGIN_ERROR_NONE;
}
return MEDIA_SVC_PLUGIN_ERROR_NONE;
}
-int delete_storage(void * handle, const char *storage_id, uid_t uid, char **err_msg)
-{
- int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
-
- if (handle == NULL) {
- __set_error_message(ERR_HANDLE, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- ret = media_svc_delete_storage(handle, storage_id, uid);
- if (ret < 0) {
- __set_error_message(ret, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- return MEDIA_SVC_PLUGIN_ERROR_NONE;
-}
-
int set_storage_validity(void * handle, const char *storage_id, int validity, uid_t uid, char **err_msg)
{
int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
int set_storage_scan_status(void *handle, const char *storage_id, int status, uid_t uid, char **err_msg)
{
- int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
- media_svc_scan_status_type_e storage_status = status;
-
- ret = media_svc_set_storage_scan_status(storage_id, storage_status, uid);
- if (ret < 0) {
- __set_error_message(ret, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
+ /* For scanner V2 */
return MEDIA_SVC_PLUGIN_ERROR_NONE;
}
int insert_item_scan(void * handle, const char *storage_id, const char *file_path, int storage_type, uid_t uid, char **err_msg)
{
- int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
-
- if (handle == NULL) {
- __set_error_message(ERR_HANDLE, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- if (!STRING_VALID(file_path)) {
- __set_error_message(ERR_FILE_PATH, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- if (!STORAGE_VALID(storage_type)) {
- __set_error_message(ERR_STORAGE_TYPE, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- ret = media_svc_insert_item_pass1(handle, storage_id, storage_type, file_path, FALSE, uid);
- if (ret < 0) {
- __set_error_message(ret, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
+ /* For scanner V2 */
return MEDIA_SVC_PLUGIN_ERROR_NONE;
}
int get_folder_scan_status(void *handle, const char *storage_id, const char *path, int *status, char **err_msg)
{
- int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
- int storage_status = 0;
-
- if (handle == NULL) {
- __set_error_message(ERR_HANDLE, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- ret = media_svc_get_folder_scan_status(handle, storage_id, path, &storage_status);
- if (ret < 0) {
- __set_error_message(ret, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- *status = storage_status;
-
- return ret;
+ /* For scanner V2 */
+ return MEDIA_SVC_PLUGIN_ERROR_NONE;
}
int set_folder_scan_status(void *handle, const char *storage_id, const char *path, int status, uid_t uid, char **err_msg)
{
- int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
- int storage_status = status;
-
- ret = media_svc_set_folder_scan_status(storage_id, path, storage_status, uid);
- if (ret < 0) {
- __set_error_message(ret, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- return ret;
+ /* For scanner V2 */
+ return MEDIA_SVC_PLUGIN_ERROR_NONE;
}
int check_folder_modified(void *handle, const char *path, const char *storage_id, bool *modified, char **err_msg)
{
- int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
- *modified = TRUE;
-
- if (handle == NULL) {
- __set_error_message(ERR_HANDLE, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- if (!STRING_VALID(path)) {
- __set_error_message(ERR_FILE_PATH, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- ret = media_svc_get_folder_modified_time(handle, path, storage_id, modified);
- if (ret < 0) {
- __set_error_message(ret, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- return ret;
+ /* For scanner V2 */
+ return MEDIA_SVC_PLUGIN_ERROR_NONE;
}
int get_null_scan_folder_list(void *handle, const char *storage_id, const char *folder_path, char ***folder_list, int *count, char **err_msg)
{
- int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
-
- if (handle == NULL) {
- __set_error_message(ERR_HANDLE, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- if (count == NULL) {
- __set_error_message(ERR_HANDLE, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- ret = media_svc_get_null_scan_folder_list(handle, storage_id, folder_path, folder_list, count);
- if (ret < 0) {
- __set_error_message(ret, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- return ret;
+ /* For scanner V2 */
+ return MEDIA_SVC_PLUGIN_ERROR_NONE;
}
int change_validity_item_batch(void **handle, const char *storage_id, const char *path, int des_validity, int src_validity, uid_t uid, char **err_msg)
{
- int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
-
- ret = media_svc_change_validity_item_batch(storage_id, path, des_validity, src_validity, uid);
- if (ret < 0) {
- __set_error_message(ret, err_msg);
- return MEDIA_SVC_PLUGIN_ERROR;
- }
-
- return ret;
+ /* For scanner V2 */
+ return MEDIA_SVC_PLUGIN_ERROR_NONE;
}
int check_folder_exist(void * handle, const char *storage_id, const char *folder_path, char **err_msg)