{
int ret = MEDIA_CONTENT_ERROR_NONE;
char *sql = NULL;
- char repl_path[MAX_QUERY_SIZE] = {0, };
if (STRING_VALID(media_id)) {
- if (STRING_VALID(thumbnail_path)) {
- memset(repl_path, 0, sizeof(repl_path));
- ret = _media_content_replace_path(thumbnail_path, repl_path);
- sql = sqlite3_mprintf(INSERT_BOOKMARK_TO_BOOKMARK, media_id, time, repl_path);
- } else {
- sql = sqlite3_mprintf(INSERT_BOOKMARK_TO_BOOKMARK, media_id, time, thumbnail_path);
- }
+ sql = sqlite3_mprintf(INSERT_BOOKMARK_TO_BOOKMARK, media_id, time, thumbnail_path);
ret = _content_query_sql(sql);
SQLITE3_SAFE_FREE(sql);
} else {
sqlite3_stmt *stmt = NULL;
attribute_h attr = NULL;
filter_s *_filter = (filter_s*)filter;
-#ifndef _USE_TV_PROFILE
char *tmp_path = NULL;
char repl_path[MAX_QUERY_SIZE] = {0, };
-#endif
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));
-#ifdef _USE_TV_PROFILE
- _folder->path = g_strdup((const char *)sqlite3_column_text(stmt, 1));
-#else
+
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);
-#endif
+
_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;
-#ifndef _USE_TV_PROFILE
char *tmp_path = NULL;
char repl_path[MAX_QUERY_SIZE] = {0, };
-#endif
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));
-#ifdef _USE_TV_PROFILE
- _playlist->thumbnail_path = g_strdup((const char *)sqlite3_column_text(stmt, 2));
-#else
+
memset(repl_path, 0x00, sizeof(repl_path));
tmp_path = g_strdup((const char *)sqlite3_column_text(stmt, 2));
if (STRING_VALID(tmp_path)) {
} else {
_playlist->thumbnail_path = NULL;
}
-#endif
if (callback((media_playlist_h)_playlist, user_data) == false) {
media_playlist_destroy((media_playlist_h)_playlist);
sqlite3_stmt *stmt = NULL;
attribute_h attr = NULL;
filter_s *_filter = (filter_s*)filter;
-#ifndef _USE_TV_PROFILE
- char *tmp_path = NULL;
- char repl_path[MAX_QUERY_SIZE] = {0, };
-#endif
attr = _content_get_attirbute_handle();
bookmark->bookmark_id = (int)sqlite3_column_int(stmt, 0);
bookmark->media_id = g_strdup((const char *)sqlite3_column_text(stmt, 1));
bookmark->marked_time = (int)sqlite3_column_int(stmt, 2);
-#ifdef _USE_TV_PROFILE
bookmark->thumbnail_path = g_strdup((const char *)sqlite3_column_text(stmt, 3));
-#else
- tmp_path = g_strdup((const char *)sqlite3_column_text(stmt, 3));
- if (STRING_VALID(tmp_path)) {
- _media_content_rollback_path(tmp_path, repl_path);
- bookmark->thumbnail_path = g_strdup(repl_path);
- SAFE_FREE(tmp_path);
- } else {
- bookmark->thumbnail_path = NULL;
- }
-#endif
-
bookmark->name = g_strdup((const char *)sqlite3_column_text(stmt, 4));
if (callback((media_bookmark_h)bookmark, user_data) == false) {
int ret = MEDIA_CONTENT_ERROR_NONE;
sqlite3_stmt *stmt = NULL;
char select_query[DEFAULT_QUERY_SIZE];
-#ifndef _USE_TV_PROFILE
char *tmp_path = NULL;
char repl_path[MAX_QUERY_SIZE] = {0, };
-#endif
if (!STRING_VALID(folder_id)) {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
media_content_error("folder handle %x", _folder);
_folder->folder_id = g_strdup((const char *)sqlite3_column_text(stmt, 0));
-#ifdef _USE_TV_PROFILE
- _folder->path = g_strdup((const char *)sqlite3_column_text(stmt, 1));
-#else
+
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);
-#endif
_folder->name = g_strdup((const char *)sqlite3_column_text(stmt, 2));
_folder->modified_time = (int)sqlite3_column_int(stmt, 3);
void _media_info_item_get_detail(sqlite3_stmt* stmt, media_info_h media)
{
media_info_s *_media = (media_info_s*)media;
-#ifndef _USE_TV_PROFILE
+
char *tmp_path = NULL;
char repl_path[MAX_QUERY_SIZE] = {0, };
-#endif
_media->media_id = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_UUID));
-#ifdef _USE_TV_PROFILE
- _media->file_path = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_PATH));
-#else
+
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);
-#endif
+
_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));
static int __media_info_map_data_usr_to_svc(media_info_s *media, media_svc_content_info_s **service_content, media_content_storage_e storage_type)
{
media_content_retvm_if(media == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid handle");
-#ifndef _USE_TV_PROFILE
char repl_path[MAX_QUERY_SIZE] = {0, };
char *tmp_path = NULL;
-#endif
media_svc_content_info_s *svc_content_info = calloc(1, sizeof(media_svc_content_info_s));
media_content_retvm_if(svc_content_info == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
-#ifdef _USE_TV_PROFILE
- svc_content_info->path = g_strdup(media->file_path);
-#else
memset(repl_path, 0, sizeof(repl_path));
tmp_path = g_strdup(media->file_path);
_media_content_replace_path(tmp_path, repl_path);
svc_content_info->path = g_strdup(repl_path);
SAFE_FREE(tmp_path);
-#endif
+
svc_content_info->file_name = g_strdup(media->display_name);
svc_content_info->media_type = media->media_type;
svc_content_info->mime_type = g_strdup(media->mime_type);
{
int ret = MEDIA_CONTENT_ERROR_NONE;
media_playlist_s *_playlist = (media_playlist_s*)playlist;
- char repl_path[MAX_QUERY_SIZE] = {0, };
if (_playlist != NULL && STRING_VALID(path)) {
SAFE_FREE(_playlist->thumbnail_path);
- memset(repl_path, 0, sizeof(repl_path));
- ret = _media_content_replace_path(path, repl_path);
- media_content_retvm_if(!STRING_VALID(repl_path), MEDIA_CONTENT_ERROR_INVALID_OPERATION, "path replacement failed");
-
media_playlist_item_s *item = (media_playlist_item_s*)calloc(1, sizeof(media_playlist_item_s));
media_content_retvm_if(item == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- item->thumbnail_path = strdup(repl_path);
+ item->thumbnail_path = g_strdup(path);
item->function = MEDIA_PLAYLIST_UPDATE_THUMBNAIL_PATH;
if (item->thumbnail_path == NULL) {
SAFE_FREE(item);
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+#ifdef _USE_TV_PROFILE
+ snprintf(replace_path, MAX_QUERY_SIZE, "%s", path);
+#else
if (!STRING_VALID(g_old_path)) {
ret = storage_get_root_directory(STORAGE_TYPE_INTERNAL, &g_old_path);
if (ret != STORAGE_ERROR_NONE) {
} else {
snprintf(replace_path, MAX_QUERY_SIZE, "%s", path);
}
+#endif
if (!STRING_VALID(replace_path)) {
media_content_error("replace failed");
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+#ifdef _USE_TV_PROFILE
+ snprintf(replace_path, MAX_QUERY_SIZE, "%s", path);
+#else
+
if (!STRING_VALID(g_old_path)) {
ret = storage_get_root_directory(STORAGE_TYPE_INTERNAL, &g_old_path);
if (ret != STORAGE_ERROR_NONE) {
} else {
snprintf(replace_path, MAX_QUERY_SIZE, "%s", path);
}
+#endif
if (!STRING_VALID(replace_path)) {
media_content_error("replace failed");