+capi-content-media-content (0.1.0-13) unstable; urgency=low
+
+ * changed the query
+ * Git: api/media-content
+ * Tag: capi-content-media-content_0.1.0-13
+
+ -- Dongyoung Kim <dydot1.kim@samsung.com> Fri, 10 Feb 2012 16:27:25 +0900
+
capi-content-media-content (0.1.0-10) unstable; urgency=low
* Update the version.
*/\r
typedef enum\r
{\r
- MEDIA_CONTENT_STORAGE_INTERNAL = 0x01 << 0, /**< The device's internal storage */ \r
- MEDIA_CONTENT_STORAGE_EXTERNAL = 0x01 << 1, /**< The device's external storage */ \r
+ MEDIA_CONTENT_STORAGE_INTERNAL, /**< The device's internal storage */ \r
+ MEDIA_CONTENT_STORAGE_EXTERNAL, /**< The device's external storage */ \r
//MEDIA_CONTENT_STORAGE_WEB = 0x01<< 2,\r
} media_content_storage_e;\r
\r
typedef enum\r
{\r
MEDIA_FOLDER_SEARCH_NONE = 0x00, /**< No Search */\r
- MEDIA_FOLDER_SEARCH_BY_FOLDER_NAME = 0x01 << 0, /**< The searchabe type folder name */\r
+ MEDIA_FOLDER_SEARCH_BY_FOLDER_NAME = 0x01 << 0, /**< The searchable type folder name */\r
}media_folder_search_type_e;\r
\r
/**\r
typedef enum\r
{\r
MEDIA_AUDIO_SEARCH_NONE = 0x00, /**< No Search */\r
- MEDIA_AUDIO_SEARCH_BY_PLAYLIST = 0x01 << 0, /**< The searchabe type of playlist */\r
- MEDIA_AUDIO_SEARCH_BY_ARTIST = 0x01 << 1, /**< The searchabe type of artist */\r
- MEDIA_AUDIO_SEARCH_BY_ALBUM = 0x01 << 2, /**< The searchabe type of album */\r
- MEDIA_AUDIO_SEARCH_BY_AUTHOR = 0x01 << 3, /**< The searchabe type of author */\r
- MEDIA_AUDIO_SEARCH_BY_GENRE = 0x01 << 4, /**< The searchabe type of genre */\r
+ MEDIA_AUDIO_SEARCH_BY_PLAYLIST = 0x01 << 0, /**< The searchable type of playlist */\r
+ MEDIA_AUDIO_SEARCH_BY_ARTIST = 0x01 << 1, /**< The searchable type of artist */\r
+ MEDIA_AUDIO_SEARCH_BY_ALBUM = 0x01 << 2, /**< The searchable type of album */\r
+ MEDIA_AUDIO_SEARCH_BY_AUTHOR = 0x01 << 3, /**< The searchable type of author */\r
+ MEDIA_AUDIO_SEARCH_BY_GENRE = 0x01 << 4, /**< The searchable type of genre */\r
}media_audio_search_type_e;\r
\r
/**\r
typedef enum\r
{\r
MEDIA_TAG_SEARCH_NONE = 0x00, /**< No Search */\r
- MEDIA_TAG_SEARCH_BY_TAG_NAME = 0x01 << 0, /**< The searchabe type folder name */\r
+ MEDIA_TAG_SEARCH_BY_TAG_NAME = 0x01 << 0, /**< The searchable type folder name */\r
}media_tag_search_type_e;\r
\r
\r
\r
/**\r
* @ingroup CAPI_CONTENT_MEDIA_FILTER_INFO_MODULE\r
- * @brief The handle to media infon filter.\r
+ * @brief The handle to media info filter.\r
*/\r
typedef struct media_info_filter_s* media_info_filter_h;\r
\r
*\r
* @remarks To use the @a media outside this function, copy the handle with #media_info_clone() function. \r
*\r
- * @param[in] media The hande to media info\r
+ * @param[in] media The handle to media info\r
* @param[in] user_data The user data passed from the foreach function \r
* @return true to continue with the next iteration of the loop, \r
* @return false to break out of the loop.\r
int media_folder_get_storage_type(media_folder_h folder, media_content_storage_e *storage_type);\r
\r
/**\r
- * @brief Gets the modifed date of the folder.\r
+ * @brief Gets the modified date of the folder.\r
*\r
* @param[in] folder The handle to media folder\r
- * @param[out] date The modifed date of folder \r
+ * @param[out] date The modified date of folder \r
* @return 0 on success, otherwise a negative error value.\r
* @retval #MEDIA_CONTENT_ERROR_NONE Successful\r
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter\r
/**
* @brief Destroys the media info.
- * @details The function frees all resources related to the meida info handle. This handle
+ * @details The function frees all resources related to the media info handle. This handle
* no longer can be used to perform any operation. New media info handle has to
* be created before next usage.
*
#define QUERY_KEYWORD_SPACE " "
#define DB_FIELD_FOLDER_UID "folder_uuid"
#define DB_FILED_DISPLAY_NAME "display_name"
+#define DB_FILED_DATE_MODIFIED "date_modified"
#define DB_FILED_MODIFIED_DATE "modified_date"
#define DB_FILED_NAME "name"
#define DB_FIELD_THUMBNAIL_PATH "thumbnail_path"
#define DB_FIELD_ADDED_TIME "added_time"
#define SELECT_MEDIA_ITEM "select item_id, file_path, display_name, thumbnail, date_modified,content_type, favourite from item_view where 1"
-#define SELECT_ALL_FOLDER "select uuid, path, name, storage_type,modified_date from (select uuid, path, folder_name as name, storage_type,modified_date from visual_folder where valid=1 union select _id, path, folder_name as name, storage_type,modified_date from audio_folder) where 1"
+#define SELECT_ALL_FOLDER "select folder_uuid, path, name, storage_type,modified_date from (select folder_uuid, path, folder_name as name, storage_type,modified_date from visual_folder where valid=1 union select audio_uuid, path, folder_name as name, storage_type,modified_date from audio_folder) where 1"
#define SELECT_COUNT_ITEM "select count(*) from item_view where 1"
#define SELECT_TAG_LIST "select _id, tag_name from visual_tag where 1"
-#define SELECT_MEDIA_FROM_TAG "SELECT t._id, tm.media_uuid, m.display_name as display_name, modified_date from ( select _id, tag_name from visual_tag WHERE tag_name='%s' ORDER BY tag_name ASC ) t, ( select media_uuid, tag_id from visual_tag_map ) tm, ( select uuid, folder_uuid, display_name, modified_date from visual_media) m, ( select uuid, lock_status from visual_folder where valid=1 ) f where tm.tag_id = t._id and m.uuid = tm.media_uuid and m.folder_uuid = f.uuid and f.lock_status=0 "
+#define SELECT_MEDIA_FROM_TAG "SELECT t._id, tm.visual_uuid, m.display_name as display_name, modified_date from ( select _id, tag_name from visual_tag WHERE tag_name='%s' ORDER BY tag_name ASC ) t, ( select visual_uuid, tag_id from visual_tag_map ) tm, ( select visual_uuid, folder_uuid, display_name, modified_date from visual_media) m, ( select folder_uuid, lock_status from visual_folder where valid=1 ) f where tm.tag_id = t._id and m.visual_uuid = tm.visual_uuid and m.folder_uuid = f.folder_uuid and f.lock_status=0 "
#define SELECT_PLAYLIST "select _id,name from audio_playlists where 1"
-#define SELECT_MEDIA_FROM_PLAYLIST "select item_id, file_path, display_name, thumbnail, date_modified,content_type, favourite from item_view where 1 and content_type=3 and item_id IN (select audio_id from audio_playlists_map where playlist_id=%d)"
+#define SELECT_MEDIA_FROM_PLAYLIST "select item_id, file_path, display_name, thumbnail, date_modified,content_type, favourite from item_view where 1 and content_type=3 and item_id IN (select audio_uuid from audio_playlists_map where playlist_id=%d)"
#define SELECT_GENRE_LIST "select distinct genre as name from audio_media where valid=1"
-#define SELECT_MEDIA_FROM_GENRE "select audio_id ,path ,title as display_name,thumbnail_path,modified_date, content_type, favourite,valid,folder_id from audio_media where valid=1 and genre='%s'"
+#define SELECT_MEDIA_FROM_GENRE "select audio_uuid ,path ,title as display_name,thumbnail_path,modified_date, content_type, favourite,valid,folder_uuid from audio_media where valid=1 and genre='%s'"
#define SELECT_MEDIA_COUNT_FROM_GENRE "select count(*) from audio_media where valid=1 and genre='%s'"
#define SELECT_ALBUM_LIST "select distinct album as name from audio_media where valid=1 "
-#define SELECT_MEDIA_FROM_ALBUM "select audio_id ,path ,title as display_name,thumbnail_path,modified_date, content_type, favourite,valid,folder_id from audio_media where valid=1 and album='%s'"
+#define SELECT_MEDIA_FROM_ALBUM "select audio_uuid ,path ,title as display_name,thumbnail_path,modified_date, content_type, favourite,valid,folder_uuid from audio_media where valid=1 and album='%s'"
#define SELECT_MEDIA_COUNT_FROM_ALBUM "select count(*) from audio_media where valid=1 and genre='%s'"
#define SELECT_AUTHOR_LIST "select distinct author as name from audio_media where valid=1 "
-#define SELECT_MEDIA_FROM_AUTHOR "select audio_id ,path ,title as display_name,thumbnail_path,modified_date, content_type, favourite,valid,folder_id from audio_media where valid=1 and author='%s'"
+#define SELECT_MEDIA_FROM_AUTHOR "select audio_uuid ,path ,title as display_name,thumbnail_path,modified_date, content_type, favourite,valid,folder_uuid from audio_media where valid=1 and author='%s'"
#define SELECT_MEDIA_COUNT_FROM_AUTHOR "select count(*) from audio_media where valid=1 and genre='%s'"
#define SELECT_MEDIA_ARTIST_LIST "select distinct artist as name from audio_media where valid=1"
-#define SELECT_MEDIA_FROM_ARTIST "select audio_id ,path ,title as display_name,thumbnail_path,modified_date, content_type, favourite,valid,folder_id from audio_media where valid=1 and artist='%s'"
+#define SELECT_MEDIA_FROM_ARTIST "select audio_uuid ,path ,title as display_name,thumbnail_path,modified_date, content_type, favourite,valid,folder_uuid from audio_media where valid=1 and artist='%s'"
#define SELECT_MEDIA_COUNT_FROM_ARTIST "select count(*) from audio_media where valid=1 and genre='%s'"
-#define SELECT_BOOKMARK_FROM_VIDEO "select _id,media_uuid,marked_time,thumbnail_path from video_bookmark where media_uuid='%s' "
+#define SELECT_BOOKMARK_FROM_VIDEO "select _id,visual_uuid,marked_time,thumbnail_path from video_bookmark where visual_uuid='%s' "
/**
* @details This function gets all video bookmarks associated with the given folder and meeting desired filter option and
calls registered callback function for every retrieved item. If NULL is passed to the @a filter, no filtering is applied.
* @remarks Only start position and offset details of filter can be set,
- * beacuse searching by bookmark name information is not supported.
+ * because searching by bookmark name information is not supported.
*
* @param [in] video The handle to video metadata
* @param [in] filter The handle to video bookmark filter
\r
\r
#include <media_content.h>\r
-#include <media-info-error.h>\r
-#include <media-svc-error.h>\r
-#include <media-info.h>\r
+#include <media-svc.h>\r
#include <audio-svc.h>\r
#include <audio-svc-error.h>\r
#include <media_info_private.h>\r
\r
#define LOG_TAG "TIZEN_N_MEDIACONTENT"\r
\r
-\r
+extern MediaSvcHandle* db_handle;\r
\r
int audio_meta_destroy(audio_meta_h audio)\r
{\r
\r
if(_audio != NULL)\r
{\r
- ret = audio_svc_update_item_metadata(_audio->audio_id,AUDIO_SVC_TRACK_DATA_PLAYED_COUNT,count,-1);\r
+ ret = audio_svc_update_item_metadata(db_handle,_audio->audio_id,AUDIO_SVC_TRACK_DATA_PLAYED_COUNT,count,-1);\r
\r
ret = _content_error_capi(MEDIA_CONTENT_TYPE,ret);\r
}\r
\r
if(_audio != NULL)\r
{\r
- ret = audio_svc_update_item_metadata(_audio->audio_id,AUDIO_SVC_TRACK_DATA_PLAYED_TIME,time,-1);\r
+ ret = audio_svc_update_item_metadata(db_handle,_audio->audio_id,AUDIO_SVC_TRACK_DATA_PLAYED_TIME,time,-1);\r
ret = _content_error_capi(MEDIA_CONTENT_TYPE,ret); \r
}\r
else\r
\r
if(_playlist != NULL)\r
{\r
- ret = audio_svc_count_playlist_item(_playlist->playlist_id,NULL,NULL, count);\r
+ ret = audio_svc_count_playlist_item(db_handle,_playlist->playlist_id,NULL,NULL, count);\r
\r
ret = _content_error_capi(MEDIA_CONTENT_TYPE,ret);\r
}\r
}\r
\r
\r
- ret = audio_svc_add_playlist(name,&playlist_id);\r
+ ret = audio_svc_add_playlist(db_handle,name,&playlist_id);\r
ret = _content_error_capi(MEDIA_CONTENT_TYPE,ret);\r
if(ret != MEDIA_CONTENT_ERROR_NONE)\r
{\r
\r
if(_playlist != NULL)\r
{\r
- ret = audio_svc_delete_playlist(_playlist->playlist_id);\r
+ ret = audio_svc_delete_playlist(db_handle,_playlist->playlist_id);\r
\r
ret = _content_error_capi(MEDIA_CONTENT_TYPE,ret);\r
}\r
\r
if(_playlist != NULL && name != NULL)\r
{\r
- ret = audio_svc_update_playlist_name(_playlist->playlist_id,name);\r
+ ret = audio_svc_update_playlist_name(db_handle,_playlist->playlist_id,name);\r
ret = _content_error_capi(MEDIA_CONTENT_TYPE,ret);\r
if(ret == MEDIA_CONTENT_ERROR_NONE)\r
{\r
if(_playlist != NULL && _item != NULL && _item->media_type == 4)\r
{\r
\r
- ret = audio_svc_add_item_to_playlist(_playlist->playlist_id,_item->item_id);\r
+ ret = audio_svc_add_item_to_playlist(db_handle,_playlist->playlist_id,_item->item_id);\r
\r
ret = _content_error_capi(MEDIA_CONTENT_TYPE,ret);\r
\r
if(_playlist != NULL && _item != NULL && _item->media_type == 4)\r
{\r
\r
- ret = audio_svc_remove_item_from_playlist_by_audio_id(_playlist->playlist_id,_item->item_id);\r
+ ret = audio_svc_remove_item_from_playlist_by_audio_id(db_handle,_playlist->playlist_id,_item->item_id);\r
\r
ret = _content_error_capi(MEDIA_CONTENT_TYPE,ret); \r
}\r
#include <audio-svc.h>\r
#include <audio-svc-error.h>\r
#include <audio-svc-types.h>\r
-#include <media-info-error.h>\r
-#include <media-svc-error.h>\r
-#include <minfo-types.h>\r
-#include <minfo-api.h>\r
-#include <media-info.h>\r
+#include <visual-svc-types.h>\r
+#include <visual-svc.h>\r
+#include <media-svc.h>\r
\r
\r
#include <dlog.h>\r
\r
#define LOG_TAG "TIZEN_N_MEDIACONTENT"\r
\r
-static sqlite3* db_handle;\r
-\r
+MediaSvcHandle* db_handle = NULL;\r
+static int ref_count = 0;\r
\r
\r
\r
int media_content_connect()\r
{\r
int ret = MEDIA_CONTENT_ERROR_NONE;\r
- int _ret;\r
- _ret = mediainfo_connect_db_with_handle(&db_handle);\r
\r
- ret = _content_error_capi(MEDIA_CONTENT_TYPE,_ret);\r
- if( ret == MEDIA_CONTENT_ERROR_NONE)\r
+ if(ref_count == 0)\r
+ {\r
+ if(db_handle == NULL)\r
{\r
- _ret = mediainfo_open();\r
- ret = _content_error_capi(MEDIA_CONTENT_TYPE,_ret);\r
+ ret = media_svc_connect(&db_handle);\r
}\r
+\r
+ ret = _content_error_capi(MEDIA_CONTENT_TYPE,ret);\r
+ }\r
+\r
+ ref_count++;\r
+ \r
return ret;\r
}\r
\r
int media_content_disconnect()\r
{\r
int ret = MEDIA_CONTENT_ERROR_NONE;\r
- int _ret;\r
\r
+ if(ref_count > 0)\r
+ {\r
+ ref_count--;\r
+ }\r
+ else\r
+ {\r
+ LOGE("[%s]DB_FAILED(0x%08x) database is not connected", __FUNCTION__, MEDIA_CONTENT_ERROR_DB_FAILED);\r
+ return MEDIA_CONTENT_ERROR_DB_FAILED;\r
+ }\r
+\r
+ if(ref_count == 0)\r
+ {\r
if(db_handle != NULL)\r
{\r
- _ret = mediainfo_disconnect_db_with_handle(db_handle);\r
- ret = _content_error_capi(MEDIA_CONTENT_TYPE,_ret);\r
+ ret = media_svc_disconnect(db_handle);\r
+ ret = _content_error_capi(MEDIA_CONTENT_TYPE,ret);\r
if( ret == MEDIA_CONTENT_ERROR_NONE)\r
{ \r
- _ret = mediainfo_close();\r
- ret = _content_error_capi(MEDIA_CONTENT_TYPE,_ret);\r
db_handle = NULL;\r
}\r
}\r
\r
+ }\r
+ \r
return ret;\r
}\r
\r
snprintf(query,len_query,"%s %s %s %s %s",select_query,condition_query,search_query,order,limit_query );\r
\r
LOGV("[%s]Query : %s",__func__,query); \r
- if( sqlite3_prepare(db_handle, query, strlen(query),stmt, NULL) != SQLITE_OK )\r
+ if( sqlite3_prepare((sqlite3*)db_handle, query, strlen(query),stmt, NULL) != SQLITE_OK )\r
{\r
- LOGE("[%s]DB_FAILED(0x%08x) fail to sqlite3_prepare(), %s", __FUNCTION__, MEDIA_CONTENT_ERROR_DB_FAILED,sqlite3_errmsg(db_handle));\r
+ LOGE("[%s]DB_FAILED(0x%08x) fail to sqlite3_prepare(), %s", __FUNCTION__, MEDIA_CONTENT_ERROR_DB_FAILED,sqlite3_errmsg((sqlite3*)db_handle));\r
exit(1);\r
} \r
free(query);\r
#include <audio-svc.h>\r
#include <audio-svc-error.h>\r
#include <audio-svc-types.h>\r
-#include <media-info-error.h>\r
-#include <media-svc-error.h>\r
-#include <minfo-types.h>\r
-#include <minfo-api.h>\r
-#include <media-info.h>\r
+#include <visual-svc-types.h>\r
+#include <visual-svc.h>\r
+#include <media-svc.h>\r
\r
#include <dlog.h>\r
\r
#include <audio-svc.h>\r
#include <audio-svc-error.h>\r
#include <audio-svc-types.h>\r
-#include <media-info-error.h>\r
-#include <media-svc-error.h>\r
-#include <minfo-types.h>\r
-#include <minfo-api.h>\r
+#include <visual-svc-types.h>\r
+#include <visual-svc.h>\r
\r
#include <dlog.h>\r
\r
#include <media_image.h>
#include <media_content.h>
#include <media_info_private.h>
-#include <media-info-error.h>
-#include <media-svc-error.h>
-#include <minfo-types.h>
-#include <minfo-api.h>
-#include <media-info.h>
+#include <visual-svc-types.h>
+#include <visual-svc.h>
+#include <media-svc.h>
#include <dlog.h>
\r
#include <media_content.h>\r
#include <media_info_private.h>\r
-#include <media-info-error.h>\r
-#include <media-svc-error.h>\r
-#include <media-info.h>\r
+#include <media-svc.h>\r
#include <audio-svc.h>\r
#include <audio-svc-error.h>\r
#include <audio-svc-types.h>\r
\r
-#include <media-svc-error.h>\r
-#include <minfo-types.h>\r
-#include <minfo-api.h>\r
-#include <media-info.h>\r
+#include <visual-svc-error.h>\r
+#include <visual-svc-types.h>\r
+#include <visual-svc.h>\r
\r
#include <drm-service.h>\r
#include <aul.h>\r
\r
#define LOG_TAG "TIZEN_N_MEDIACONTENT"\r
\r
+extern MediaSvcHandle* db_handle;\r
\r
-#define SELECT_AUDIO_FROM_MEDIA "select audio_id,genre,album,artist,author,year,copyright,description,format,bitrate,track_num,duration,rating,played_count,last_played_time,added_time,size,category from audio_media where audio_id='%s' "\r
-#define SELECT_TAG_LIST_FROM_MEDIA "select t._id, t.tag_name from (select _id, tag_name from visual_tag ORDER BY tag_name ASC ) t, ( select media_uuid, tag_id from visual_tag_map where media_uuid='%s' ) tm, ( select uuid, folder_uuid from visual_media) m, ( select uuid, lock_status from visual_folder where valid=1 ) f where tm.tag_id = t._id and m.uuid = tm.media_uuid and m.folder_uuid = f.uuid and f.lock_status=0; "\r
+\r
+#define SELECT_AUDIO_FROM_MEDIA "select audio_uuid,genre,album,artist,author,year,copyright,description,format,bitrate,track_num,duration,rating,played_count,last_played_time,added_time,size,category from audio_media where audio_uuid='%s' "\r
+#define SELECT_TAG_LIST_FROM_MEDIA "select t._id, t.tag_name from (select _id, tag_name from visual_tag ORDER BY tag_name ASC ) t, ( select visual_uuid, tag_id from visual_tag_map where visual_uuid='%s' ) tm, ( select visual_uuid, folder_uuid from visual_media) m, ( select folder_uuid, lock_status from visual_folder where valid=1 ) f where tm.tag_id = t._id and m.visual_uuid = tm.visual_uuid and m.folder_uuid = f.folder_uuid and f.lock_status=0; "\r
\r
int media_info_insert_to_db(media_content_type_e type,const char* path)\r
{\r
{\r
case MEDIA_CONTENT_TYPE_IMAGE:\r
_type = MINFO_ITEM_IMAGE;\r
- ret = minfo_add_media(path, _type);\r
+ ret = minfo_add_media(db_handle, path, _type);\r
ret = _content_error_capi(MEDIA_CONTENT_TYPE, ret);\r
break;\r
case MEDIA_CONTENT_TYPE_VIDEO:\r
_type = MINFO_ITEM_VIDEO;\r
- ret = minfo_add_media(path, _type);\r
+ ret = minfo_add_media(db_handle, path, _type);\r
ret = _content_error_capi(MEDIA_CONTENT_TYPE, ret); \r
break;\r
\r
ret = _content_get_audio_category(path,&category);\r
if(ret >= 0)\r
{\r
- ret = audio_svc_insert_item(storage_type,path,category); \r
+ ret = audio_svc_insert_item(db_handle, storage_type,path,category); \r
}\r
else\r
{\r
{\r
if(favorite)\r
{\r
- ret = audio_svc_add_item_to_playlist( AUDIO_SVC_FAVORITE_LIST_ID, _media->item_id);\r
+ ret = audio_svc_add_item_to_playlist( db_handle, AUDIO_SVC_FAVORITE_LIST_ID, _media->item_id);\r
}\r
else\r
{\r
- ret = audio_svc_remove_item_from_playlist_by_audio_id(AUDIO_SVC_FAVORITE_LIST_ID, _media->item_id);\r
+ ret = audio_svc_remove_item_from_playlist_by_audio_id(db_handle, AUDIO_SVC_FAVORITE_LIST_ID, _media->item_id);\r
}\r
}\r
else\r
{ \r
- ret = minfo_update_media_favorite(_media->item_id,favorite);\r
+ ret = minfo_update_media_favorite(db_handle, _media->item_id,favorite);\r
}\r
ret = _content_error_capi(MEDIA_CONTENT_TYPE,ret);\r
}\r
}\r
else if(_filter->order == MEDIA_CONTENT_SORT_BY_DATE_ASC)\r
{\r
- snprintf(order_query,sizeof(order_query),"%s %s",QUERY_KEYWORD_ORDER_BY,DB_FILED_MODIFIED_DATE);\r
+ snprintf(order_query,sizeof(order_query),"%s %s",QUERY_KEYWORD_ORDER_BY,DB_FILED_DATE_MODIFIED);\r
}\r
else if(_filter->order == MEDIA_CONTENT_SORT_BY_DATE_DESC)\r
{\r
- snprintf(order_query,sizeof(order_query),"%s %s %s",QUERY_KEYWORD_ORDER_BY,DB_FILED_MODIFIED_DATE,QUERY_KEYWORD_DESC); \r
+ snprintf(order_query,sizeof(order_query),"%s %s %s",QUERY_KEYWORD_ORDER_BY,DB_FILED_DATE_MODIFIED,QUERY_KEYWORD_DESC); \r
}\r
\r
\r
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;\r
}\r
\r
- p_ret = minfo_get_item_by_id(_item->item_id,&p_item);\r
+ p_ret = minfo_get_item_by_id(db_handle, _item->item_id,&p_item);\r
\r
ret = _content_error_capi(MEDIA_CONTENT_TYPE,p_ret);\r
if( (ret == MEDIA_CONTENT_ERROR_NONE) && ( p_item != NULL))\r
{\r
- ret = minfo_get_meta_info(_item->item_id,&(p_item->meta_info));\r
+ ret = minfo_get_meta_info(db_handle, _item->item_id,&(p_item->meta_info));\r
ret = _content_error_capi(MEDIA_CONTENT_TYPE,p_ret); \r
\r
if( ret != MEDIA_CONTENT_ERROR_NONE)\r
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;\r
}\r
\r
- p_ret = minfo_get_item_by_id(_item->item_id,&p_item);\r
+ p_ret = minfo_get_item_by_id(db_handle, _item->item_id,&p_item);\r
\r
\r
ret = _content_error_capi(MEDIA_CONTENT_TYPE,p_ret);\r
if( (ret == MEDIA_CONTENT_ERROR_NONE) && ( p_item != NULL))\r
{\r
- ret = minfo_get_meta_info(_item->item_id,&(p_item->meta_info));\r
+ ret = minfo_get_meta_info(db_handle, _item->item_id,&(p_item->meta_info));\r
ret = _content_error_capi(MEDIA_CONTENT_TYPE,p_ret); \r
if( ret != MEDIA_CONTENT_ERROR_NONE)\r
{\r
*category = FEX_CATEGORY_MUSIC;\r
*category = *category | FEX_CATEGORY_DRM;\r
}\r
- else //check music file in soun files.\r
+ else //check music file in sound files.\r
{\r
int prefix_len = strlen(content_category[0].content_type);\r
\r
#include <audio-svc.h>\r
#include <audio-svc-error.h>\r
#include <audio-svc-types.h>\r
-#include <media-info-error.h>\r
-#include <media-svc-error.h>\r
-#include <minfo-types.h>\r
-#include <minfo-api.h>\r
+#include <visual-svc-types.h>\r
+#include <visual-svc.h>\r
#include <dlog.h>\r
\r
#ifdef LOG_TAG\r
\r
#define LOG_TAG "TIZEN_N_MEDIACONTENT"\r
\r
+extern MediaSvcHandle* db_handle;\r
\r
\r
int media_tag_foreach_tag_from_db(media_tag_filter_h filter, media_tag_cb callback,void* user_data)\r
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;\r
}\r
\r
- ret = minfo_add_tag(NULL,tag_name);\r
+ ret = minfo_add_tag(db_handle,NULL,tag_name);\r
\r
if(ret == MB_SVC_ERROR_NONE)\r
{\r
media_tag_s* _tag = (media_tag_s*)tag;\r
\r
\r
- ret = minfo_delete_tag(NULL, _tag->name);\r
+ ret = minfo_delete_tag(db_handle, NULL, _tag->name);\r
\r
return _content_error_capi(MEDIA_CONTENT_TYPE,ret);\r
\r
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; \r
}\r
\r
- ret = minfo_add_tag(_item->item_id,_tag->name);\r
+ ret = minfo_add_tag(db_handle, _item->item_id,_tag->name);\r
\r
return _content_error_capi(MEDIA_CONTENT_TYPE,ret);\r
\r
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;\r
}\r
\r
- query_string = sqlite3_mprintf("DELETE FROM visual_tag_map WHERE media_id=%s and tag_name=%d",\r
+ query_string = sqlite3_mprintf("DELETE FROM visual_tag_map WHERE visual_uuid=%s and tag_name=%d",\r
_item->item_id, _tag->name);\r
\r
\r
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;\r
}\r
\r
- ret = minfo_rename_tag(_tag->name,name);\r
+ ret = minfo_rename_tag(db_handle,_tag->name,name);\r
\r
if(ret == MB_SVC_ERROR_NONE)\r
{\r
}\r
memset(_item,0x00,sizeof(media_info_s));\r
media_id = (char*)sqlite3_column_text(stmt, 1);\r
- ret = minfo_get_item_by_id(media_id, &mitem);\r
+ ret = minfo_get_item_by_id(db_handle,media_id, &mitem);\r
\r
if(ret < 0)\r
{\r
#include <media_content.h>
#include <media_info_private.h>
-#include <media-info-error.h>
-#include <media-svc-error.h>
-#include <minfo-types.h>
-#include <minfo-api.h>
-#include <media-info.h>
+#include <visual-svc-error.h>
+#include <visual-svc-types.h>
+#include <visual-svc.h>
+#include <media-svc.h>
#include <dlog.h>
#define LOG_TAG "TIZEN_N_MEDIACONTENT"
+extern MediaSvcHandle* db_handle;
+
int video_meta_destroy(video_meta_h video)
{
if(_video != NULL )
{
- ret = minfo_update_video_meta_info_int(_video->video_id,MINFO_VIDEO_META_BOOKMARK_LAST_PLAYED,time_played);
+ ret = minfo_update_video_meta_info_int(db_handle,_video->video_id,MINFO_VIDEO_META_BOOKMARK_LAST_PLAYED,time_played);
ret = _content_error_capi(MEDIA_CONTENT_TYPE,ret);
}
else
if(_video != NULL)
{
- ret = minfo_add_bookmark(_video->video_id,time,thumbnail_path);
+ ret = minfo_add_bookmark(db_handle,_video->video_id,time,thumbnail_path);
ret = _content_error_capi(MEDIA_CONTENT_TYPE,ret);
}
else
if( _bookmark != NULL)
{
- ret = minfo_delete_bookmark(_bookmark->bookmark_id);
+ ret = minfo_delete_bookmark(db_handle,_bookmark->bookmark_id);
ret = _content_error_capi(MEDIA_CONTENT_TYPE,ret);
}
else