int _media_content_check_dir(const char *path);
int _media_content_replace_path_in_condition(const char *condition, char *replace_condition, bool replace);
int _media_content_replace_path(const char *path, char *replace_path);
-int _media_content_rollback_path(const char *path, char *replace_path);
int _media_content_check_dir(const char *path);
int _media_content_replace_path_in_condition(const char *condition, char *replace_condition, bool replace);
int _media_content_replace_path(const char *path, char *replace_path);
-int _media_content_rollback_path(const char *path, char *replace_path);
#ifdef _USE_SENIOR_MODE
bool _media_content_is_support_senior_mode();
sqlite3_stmt *stmt = NULL;
attribute_h attr = NULL;
filter_s *_filter = (filter_s*)filter;
- char *tmp_path = NULL;
- char repl_path[MAX_PATH_LEN] = {0, };
attr = _content_get_alias_attirbute_handle();
memset(select_query, 0x00, sizeof(select_query));
}
_folder->folder_id = g_strdup((const char *)sqlite3_column_text(stmt, 0));
-
- tmp_path = g_strdup((const char *)sqlite3_column_text(stmt, 1));
- _media_content_rollback_path(tmp_path, repl_path);
- _folder->path = g_strdup(repl_path);
- SAFE_FREE(tmp_path);
-
+ _folder->path = g_strdup((const char *)sqlite3_column_text(stmt, 1));
_folder->name = g_strdup((const char *)sqlite3_column_text(stmt, 2));
_folder->storage_type = (int)sqlite3_column_int(stmt, 3);
_folder->modified_time = (int)sqlite3_column_int(stmt, 4);
char *option_query = NULL;
sqlite3_stmt *stmt = NULL;
attribute_h attr = NULL;
- char *tmp_path = NULL;
- char repl_path[MAX_PATH_LEN] = {0, };
attr = _content_get_attirbute_handle();
memset(select_query, 0x00, sizeof(select_query));
_playlist->playlist_id = (int)sqlite3_column_int(stmt, 0);
_playlist->name = g_strdup((const char *)sqlite3_column_text(stmt, 1));
-
- memset(repl_path, 0x00, sizeof(repl_path));
- tmp_path = g_strdup((const char *)sqlite3_column_text(stmt, 2));
- if (STRING_VALID(tmp_path)) {
- _media_content_rollback_path(tmp_path, repl_path);
- _playlist->thumbnail_path = g_strdup(repl_path);
- } else {
- _playlist->thumbnail_path = NULL;
- }
-
- SAFE_FREE(tmp_path);
+ _playlist->thumbnail_path = g_strdup((const char *)sqlite3_column_text(stmt, 2));
if (callback((media_playlist_h)_playlist, user_data) == false) {
media_playlist_destroy((media_playlist_h)_playlist);
int ret = MEDIA_CONTENT_ERROR_NONE;
sqlite3_stmt *stmt = NULL;
char select_query[DEFAULT_QUERY_SIZE];
- char *tmp_path = NULL;
- char repl_path[MAX_PATH_LEN] = {0, };
media_folder_s *_folder = NULL;
if (!STRING_VALID(folder_id)) {
}
_folder->folder_id = g_strdup((const char *)sqlite3_column_text(stmt, 0));
-
- tmp_path = g_strdup((const char *)sqlite3_column_text(stmt, 1));
- _media_content_rollback_path(tmp_path, repl_path);
- _folder->path = g_strdup(repl_path);
- SAFE_FREE(tmp_path);
-
+ _folder->path = g_strdup((const char *)sqlite3_column_text(stmt, 1));
_folder->name = g_strdup((const char *)sqlite3_column_text(stmt, 2));
_folder->modified_time = (int)sqlite3_column_int(stmt, 3);
_folder->storage_type = (int)sqlite3_column_int(stmt, 5);
SAFE_FREE(_folder->path);
SAFE_FREE(_folder->name);
SAFE_FREE(folder_path);
- memset(repl_path, 0, sizeof(repl_path));
- ret = _media_content_rollback_path(new_folder_path, repl_path);
- media_content_retvm_if(!STRING_VALID(repl_path), MEDIA_CONTENT_ERROR_INVALID_OPERATION, "path replacement failed");
- _folder->path = strdup(repl_path);
+ _folder->path = strdup(new_folder_path);
media_content_retvm_if(_folder->path == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
_folder->name = strdup(name);
media_content_retvm_if(_folder->name == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
{
media_info_s *_media = (media_info_s*)media;
- char *tmp_path = NULL;
- char repl_path[MAX_PATH_LEN] = {0, };
-
_media->media_id = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_UUID));
-
- tmp_path = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_PATH));
- _media_content_rollback_path(tmp_path, repl_path);
- _media->file_path = g_strdup(repl_path);
- SAFE_FREE(tmp_path);
-
+ _media->file_path = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_PATH));
_media->display_name = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_FILE_NAME));
_media->media_type = (int)sqlite3_column_int(stmt, MEDIA_INFO_TYPE);
_media->mime_type = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_MIME_TYPE));
GList *item_list = NULL;
unsigned int idx = 0;
char repl_path[MAX_PATH_LEN] = {0, };
- char repl_item[MAX_QUERY_SIZE] = {0, };
media_content_retvm_if(!STRING_VALID(path), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid path");
media_content_retvm_if(_playlist == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid playlist");
for (idx = 0; idx < g_list_length(item_list); idx++) {
char *item = g_list_nth_data(item_list, idx);
- memset(repl_item, 0, sizeof(repl_item));
- ret = _media_content_rollback_path(item, repl_item);
-
- ret = __media_playlist_append_to_file(repl_path, repl_item);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- g_list_free_full(item_list, __media_playlist_destroy_export_item);
- media_content_error("Fail to export paths into file");
- return ret;
+ if (STRING_VALID(item)) {
+ ret = __media_playlist_append_to_file(repl_path, item);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ g_list_free_full(item_list, __media_playlist_destroy_export_item);
+ media_content_error("Fail to export paths into file");
+ return ret;
+ }
}
}
return MEDIA_CONTENT_ERROR_NONE;
}
-int _media_content_rollback_path(const char *path, char *replace_path)
-{
-#ifdef _USE_TVPD_MODE
- snprintf(replace_path, MAX_PATH_LEN, "%s", path);
-#else
- if (strncmp(path, MEDIA_ROOT_PATH_INTERNAL, strlen(MEDIA_ROOT_PATH_INTERNAL)) == 0) {
- media_content_sec_debug("new path[%s]", path);
- snprintf(replace_path, MAX_PATH_LEN, "%s%s", MEDIA_ROOT_PATH_INTERNAL_OLD, path + strlen(MEDIA_ROOT_PATH_INTERNAL));
- } else {
- snprintf(replace_path, MAX_PATH_LEN, "%s", path);
- }
-#endif
-
- if (!STRING_VALID(replace_path)) {
- media_content_error("replace failed");
- return MEDIA_CONTENT_ERROR_INVALID_OPERATION;
- }
-
- return MEDIA_CONTENT_ERROR_NONE;
-}
-
#ifdef _USE_SENIOR_MODE
bool _media_content_is_support_senior_mode()
{