int media_svc_generate_uuid(char **uuid);
int media_svc_get_mmc_info(MediaSvcHandle *handle, char **storage_name, char **storage_path, int *validity, bool *info_exist);
int media_svc_check_storage(MediaSvcHandle *handle, const char *storage_id, const char *storage_name, char **storage_path, int *validity, uid_t uid);
-int media_svc_insert_storage(MediaSvcHandle *handle, const char *storage_id, const char *storage_name, const char *storage_path, const char *storage_account, media_svc_storage_type_e storage_type, uid_t uid);
+int media_svc_insert_storage(MediaSvcHandle *handle, const char *storage_id, const char *storage_name, const char *storage_path, media_svc_storage_type_e storage_type, uid_t uid);
int media_svc_update_storage(MediaSvcHandle *handle, const char *storage_id, const char *storage_path, uid_t uid);
int media_svc_delete_storage(MediaSvcHandle *handle, const char *storage_id, const char *storage_name, uid_t uid);
int media_svc_set_storage_validity(MediaSvcHandle *handle, const char *storage_id, int validity, uid_t uid);
Name: libmedia-service
Summary: Media information service library for multimedia applications
-Version: 0.3.0
+Version: 0.3.1
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0 and PD
return MEDIA_SVC_PLUGIN_ERROR;
}
- ret = media_svc_insert_storage(handle, storage_id, storage_name, storage_path, NULL, storage_type, uid);
+ ret = media_svc_insert_storage(handle, storage_id, storage_name, storage_path, storage_type, uid);
if (ret < 0) {
__set_error_message(ret, err_msg);
return MEDIA_SVC_PLUGIN_ERROR;
media_svc_retv_if(ret != MS_MEDIA_ERR_NONE, ret);
ret = __media_svc_add_column_info(&column_list[MEDIA_SVC_DB_LIST_STORAGE], "storage_path", MEDIA_SVC_DB_TYPE_TEXT, "NOT NULL", USER_V3, NULL, false, false, false);
media_svc_retv_if(ret != MS_MEDIA_ERR_NONE, ret);
- ret = __media_svc_add_column_info(&column_list[MEDIA_SVC_DB_LIST_STORAGE], "storage_account", MEDIA_SVC_DB_TYPE_TEXT, NULL, USER_V3, NULL, false, false, false);
- media_svc_retv_if(ret != MS_MEDIA_ERR_NONE, ret);
ret = __media_svc_add_column_info(&column_list[MEDIA_SVC_DB_LIST_STORAGE], "storage_type", MEDIA_SVC_DB_TYPE_INT, "DEFAULT 0", USER_V3, NULL, false, false, false);
media_svc_retv_if(ret != MS_MEDIA_ERR_NONE, ret);
ret = __media_svc_add_column_info(&column_list[MEDIA_SVC_DB_LIST_STORAGE], "scan_status", MEDIA_SVC_DB_TYPE_INT, "DEFAULT 0", USER_V3, NULL, false, false, false);
return MS_MEDIA_ERR_NONE;
}
-int _media_svc_append_storage(const char *storage_id, const char *storage_name, const char *storage_path, const char *storage_account, media_svc_storage_type_e storage_type, uid_t uid)
+int _media_svc_append_storage(const char *storage_id, const char *storage_name, const char *storage_path, media_svc_storage_type_e storage_type, uid_t uid)
{
int ret = MS_MEDIA_ERR_NONE;
- char *sql = sqlite3_mprintf("INSERT INTO %s (storage_uuid, storage_name, storage_path, storage_account, storage_type) values (%Q, %Q, %Q, %Q, %d); ",
- MEDIA_SVC_DB_TABLE_STORAGE, storage_id, storage_name, storage_path, storage_account, storage_type);
+ char *sql = sqlite3_mprintf("INSERT INTO %s (storage_uuid, storage_name, storage_path, storage_type) values (%Q, %Q, %Q, %d); ",
+ MEDIA_SVC_DB_TABLE_STORAGE, storage_id, storage_name, storage_path, storage_type);
ret = _media_svc_sql_query(sql, uid);
SQLITE3_SAFE_FREE(sql);
return _media_svc_update_storage_path(db_handle, storage_id, storage_path, uid);
}
-int media_svc_insert_storage(MediaSvcHandle *handle, const char *storage_id, const char *storage_name, const char *storage_path, const char *storage_account, media_svc_storage_type_e storage_type, uid_t uid)
+int media_svc_insert_storage(MediaSvcHandle *handle, const char *storage_id, const char *storage_name, const char *storage_path, media_svc_storage_type_e storage_type, uid_t uid)
{
int ret = MS_MEDIA_ERR_NONE;
sqlite3 *db_handle = (sqlite3 *)handle;
media_svc_retvm_if(storage_path == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "storage_path is NULL");
media_svc_retvm_if(__media_svc_check_storage(storage_type, TRUE) != TRUE, MS_MEDIA_ERR_INVALID_PARAMETER, "Invalid storage_type");
- ret = _media_svc_append_storage(storage_id, storage_name, storage_path, storage_account, storage_type, uid);
+ ret = _media_svc_append_storage(storage_id, storage_name, storage_path, storage_type, uid);
media_svc_retvm_if(ret != MS_MEDIA_ERR_NONE, ret, "append storage failed : %d", ret);
if (strcmp(storage_id, MEDIA_SVC_DB_TABLE_MEDIA)) {
int _media_svc_init_storage(sqlite3 *handle, uid_t uid);
int _media_svc_get_mmc_info(MediaSvcHandle *handle, char **storage_name, char **storage_path, int *validity, bool *info_exist);
int _media_svc_check_storage(sqlite3 *handle, const char *storage_id, const char *storage_name, char **storage_path, int *validity, uid_t uid);
-int _media_svc_append_storage(const char *storage_id, const char *storage_name, const char *storage_path, const char *storage_account, media_svc_storage_type_e storage_type, uid_t uid);
+int _media_svc_append_storage(const char *storage_id, const char *storage_name, const char *storage_path, media_svc_storage_type_e storage_type, uid_t uid);
int _media_svc_update_storage_path(sqlite3 *handle, const char *storage_id, const char *path, uid_t uid);
int _media_svc_delete_storage(const char *storage_id, const char *storage_name, uid_t uid);
int _media_svc_update_storage_validity(const char *storage_id, int validity, uid_t uid);