int media_svc_check_pinyin_support(bool *support);
int media_svc_update_item_meta(sqlite3 *handle, uid_t uid);
-int media_svc_generate_uuid(char **uuid);
int media_svc_check_storage(sqlite3 *handle, const char *storage_id, char **storage_path, int *validity);
int media_svc_insert_storage(sqlite3 *handle, const char *storage_id, const char *storage_path, ms_user_storage_type_e storage_type, uid_t uid);
int media_svc_update_storage(sqlite3 *handle, const char *storage_id, const char *storage_path, uid_t uid);
int get_uuid(char **uuid)
{
- return media_svc_generate_uuid(uuid);
+ /* For scanner V2 */
+ return MS_MEDIA_ERR_NONE;
}
int check_storage(sqlite3 *handle, const char *storage_id, char **storage_path, int *validity, uid_t uid)
if (STRING_VALID(folder_uuid)) {
SAFE_STRLCPY(folder_id, folder_uuid, MEDIA_SVC_UUID_SIZE + 1);
+ SAFE_FREE(folder_uuid);
} else {
media_svc_error("Fail to get folder_uuid");
return MS_MEDIA_ERR_INTERNAL;
char *_media_info_generate_uuid(void)
{
uuid_t uuid_value;
- static char uuid_unparsed[37];
+ char uuid_unparsed[37];
RETRY_GEN:
uuid_generate(uuid_value);
goto RETRY_GEN;
}
- return uuid_unparsed;
+ return g_strdup(uuid_unparsed);
}
static int __media_svc_split_to_double(char *input, double *arr)
int _media_svc_set_media_info(media_svc_content_info_s *content_info, const char *storage_id, ms_user_storage_type_e storage_type, const char *path, bool refresh)
{
int ret = MS_MEDIA_ERR_NONE;
- char * media_uuid = NULL;
bool drm_type = false;
char mime_type[256] = {0, };
media_svc_media_type_e media_type;
content_info->storage_type = storage_type;
time(&content_info->added_time);
- media_uuid = _media_info_generate_uuid();
- if (media_uuid == NULL) {
- _media_svc_destroy_content_info(content_info);
- return MS_MEDIA_ERR_INTERNAL;
- }
-
- content_info->media_uuid = g_strdup(media_uuid);
+ content_info->media_uuid = _media_info_generate_uuid();
media_svc_retv_del_if(content_info->media_uuid == NULL, MS_MEDIA_ERR_INTERNAL, content_info);
content_info->file_name = g_path_get_basename(path);
{
int ret = MS_MEDIA_ERR_NONE;
char mime_type[256] = {0};
- media_svc_media_type_e media_type = MEDIA_SVC_MEDIA_TYPE_OTHER;
+ media_svc_media_type_e media_type = MEDIA_SVC_MEDIA_TYPE_OTHER;
media_svc_retvm_if(mediatype == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "mediatype is NULL");
return _media_svc_get_storage_uuid(handle, path, storage_id, uid);
}
-int media_svc_generate_uuid(char **uuid)
-{
- char *gen_uuid = NULL;
- gen_uuid = _media_info_generate_uuid();
- media_svc_retvm_if(gen_uuid == NULL, MS_MEDIA_ERR_INTERNAL, "Fail to generate uuid");
-
- *uuid = strdup(gen_uuid);
-
- return MS_MEDIA_ERR_NONE;
-}
-
int media_svc_check_storage(sqlite3 *handle, const char *storage_id, char **storage_path, int *validity)
{
return _media_svc_check_storage(handle, storage_id, storage_path, validity);