/* DB View */
#define DB_VIEW_PLAYLIST "playlist_view"
#define DB_VIEW_TAG "tag_view"
-#define DB_VIEW_MEDIA "media_view"
/* DB field for media */
#define DB_FIELD_MEDIA_DISPLAY_NAME "media_display_name"
#define QUERY_KEYWORD_COLLATE " COLLATE "
/* DB TABLE JOIN */
-#define FOLDER_MEDIA_JOIN DB_TABLE_FOLDER" NATURAL LEFT OUTER JOIN '%s' WHERE validity IN (1, 2) "
-#define BOOKMARK_MEDIA_JOIN DB_TABLE_BOOKMARK" NATURAL JOIN '%s' WHERE validity IN (1, 2) "
-#define ALBUM_MEDIA_JOIN DB_TABLE_ALBUM" NATURAL JOIN '%s' WHERE validity IN (1, 2) "
-#define FACE_MEDIA_JOIN DB_TABLE_FACE" NATURAL JOIN '%s' WHERE validity IN (1, 2) "
+#define FOLDER_MEDIA_JOIN DB_TABLE_FOLDER" NATURAL LEFT OUTER JOIN "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
+#define BOOKMARK_MEDIA_JOIN DB_TABLE_BOOKMARK" NATURAL JOIN "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
+#define ALBUM_MEDIA_JOIN DB_TABLE_ALBUM" NATURAL JOIN "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
+#define FACE_MEDIA_JOIN DB_TABLE_FACE" NATURAL JOIN "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
/* Get Group List */
#define SELECT_ALBUM_LIST "SELECT DISTINCT album_id, name, artist, album_art FROM "ALBUM_MEDIA_JOIN
-#define SELECT_MEDIA_GROUP_LIST "SELECT DISTINCT %s FROM '%s' WHERE validity IN (1, 2) "
+#define SELECT_ALBUM_LIST_BY_STORAGE_ID SELECT_ALBUM_LIST"AND storage_uuid='%s' "
+#define SELECT_MEDIA_GROUP_LIST "SELECT DISTINCT %s FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
+#define SELECT_MEDIA_GROUP_LIST_BY_STORAGE_ID SELECT_MEDIA_GROUP_LIST"AND storage_uuid='%s' "
#define SELECT_FOLDER_LIST "SELECT DISTINCT folder_id, folder_path, folder_name, folder_storage_type, storage_uuid FROM "FOLDER_MEDIA_JOIN
#define SELECT_FOLDER_LIST_BY_STORAGE_ID SELECT_FOLDER_LIST"AND storage_uuid='%s' "
/* Get Group Count */
#define SELECT_ALBUM_COUNT "SELECT COUNT(DISTINCT album_id) FROM "ALBUM_MEDIA_JOIN
+#define SELECT_ALBUM_COUNT_BY_STORAGE_ID SELECT_ALBUM_COUNT"AND storage_uuid='%s' "
#define SELECT_FOLDER_COUNT "SELECT COUNT(DISTINCT folder_id) FROM "FOLDER_MEDIA_JOIN
#define SELECT_FOLDER_COUNT_BY_STORAGE_ID SELECT_FOLDER_COUNT"AND storage_uuid='%s' "
#define SELECT_TAG_COUNT "SELECT COUNT(DISTINCT tag_id) FROM "DB_VIEW_TAG" WHERE 1 "
#define SELECT_PLAYLIST_COUNT "SELECT COUNT(DISTINCT playlist_id) FROM "DB_VIEW_PLAYLIST" WHERE 1 "
#define SELECT_BOOKMARK_COUNT "SELECT COUNT(*) FROM "BOOKMARK_MEDIA_JOIN
+#define SELECT_BOOKMARK_COUNT_BY_STORAGE_ID SELECT_BOOKMARK_COUNT"AND storage_uuid='%s' "
#define SELECT_MEDIA_GROUP_COUNT "SELECT COUNT(*) FROM ("SELECT_MEDIA_GROUP_LIST
+#define SELECT_MEDIA_GROUP_COUNT_BY_STORAGE_ID SELECT_MEDIA_GROUP_COUNT"AND storage_uuid='%s' "
/*count(distinct x) count only non-null values, but select distinct X returns include null. so sync the result of count and list, don't use count(distinct x)*/
/* Get Media Count of Group */
#define SELECT_MEDIA_COUNT_FROM_MEDIA "SELECT COUNT(*) FROM ("SELECT_MEDIA_ITEM /*to apply limit condition. "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity=1" */
-#define SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE "SELECT COUNT(*) FROM '%s' WHERE validity IN (1, 2) "
-#define SELECT_MEDIA_COUNT_FROM_ALBUM "SELECT COUNT(*) FROM '%s' WHERE validity IN (1, 2) AND album_id='%d'"
+#define SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
+#define SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE_BY_STORAGE_ID SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE"AND storage_uuid='%s' "
+#define SELECT_MEDIA_COUNT_FROM_ALBUM "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND album_id='%d' "
+#define SELECT_MEDIA_COUNT_FROM_ALBUM_BY_STORAGE_ID SELECT_MEDIA_COUNT_FROM_ALBUM"AND storage_uuid='%s' "
#define SELECT_MEDIA_COUNT_FROM_GROUP "SELECT COUNT(*) FROM ("SELECT_MEDIA_FROM_GROUP /*to apply limit condition. */
+#define SELECT_MEDIA_COUNT_FROM_GROUP_BY_STORAGE_ID "SELECT COUNT(*) FROM ("SELECT_MEDIA_FROM_GROUP_BY_STORAGE_ID /*to apply limit condition. */
#define SELECT_MEDIA_COUNT_FROM_GROUP_NULL "SELECT COUNT(*) FROM ("SELECT_MEDIA_FROM_GROUP_NULL /* to apply limit condition. */
-#define SELECT_MEDIA_COUNT_FROM_FOLDER "SELECT COUNT(*) FROM '%s' WHERE validity IN (1, 2) AND folder_id='%q'"
-#define SELECT_MEDIA_COUNT_FROM_STORAGE "SELECT COUNT(*) FROM '%s' WHERE validity IN (1, 2) AND storage_uuid='%q'"
+#define SELECT_MEDIA_COUNT_FROM_GROUP_NULL_BY_STORAGE_ID "SELECT COUNT(*) FROM ("SELECT_MEDIA_FROM_GROUP_NULL_BY_STORAGE_ID /* to apply limit condition. */
+#define SELECT_MEDIA_COUNT_FROM_FOLDER "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND folder_id='%q'"
+#define SELECT_MEDIA_COUNT_FROM_FOLDER_BY_STORAGE_ID SELECT_MEDIA_COUNT_FROM_FOLDER" AND storage_uuid='%s' "
+#define SELECT_MEDIA_COUNT_FROM_STORAGE "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND storage_uuid='%q'"
#define SELECT_MEDIA_COUNT_FROM_TAG "SELECT COUNT(*) FROM "DB_VIEW_TAG" WHERE (tag_id=%d AND tag_media_count>0) "
#define SELECT_MEDIA_COUNT_FROM_PLAYLIST "SELECT COUNT(*) FROM "DB_VIEW_PLAYLIST" WHERE (playlist_id=%d and playlist_media_count>0) "
#define INSERT_BOOKMARK_TO_BOOKMARK "INSERT INTO "DB_TABLE_BOOKMARK" (media_id, bookmark_marked_time, bookmark_thumbnail_path, bookmark_name) VALUES ('%q', '%d', %Q, %Q)"
#define SELECT_BOOKMARK_COUNT_BY_MEDIA_ID "SELECT COUNT(*) FROM "BOOKMARK_MEDIA_JOIN" AND media_id='%s'"
#define SELECT_BOOKMARK_LIST "SELECT bookmark_id, media_id, bookmark_marked_time, bookmark_thumbnail_path, bookmark_name FROM "BOOKMARK_MEDIA_JOIN
+#define SELECT_BOOKMARK_LIST_BY_STORAGE_ID SELECT_BOOKMARK_LIST"AND storage_uuid='%s' "
#define SELECT_BOOKMARK_LIST_BY_MEDIA_ID "SELECT bookmark_id, media_id, bookmark_marked_time, bookmark_thumbnail_path, bookmark_name FROM "BOOKMARK_MEDIA_JOIN" AND media_id='%s'"
#define SELECT_BOOKMARK_ID_FROM_BOOKMARK "SELECT bookmark_id FROM "DB_TABLE_BOOKMARK" WHERE media_id='%s' AND bookmark_marked_time=%d"
#define UPDATE_BOOKMARK_FROM_BOOKMARK "UPDATE "DB_TABLE_BOOKMARK" SET bookmark_name=%Q WHERE bookmark_id=%d;"
/* Update Meta*/
-#define UPDATE_IMAGE_META_FROM_MEDIA "UPDATE '%s' SET media_orientation=%d WHERE media_id='%q'"
-
-#define SELECT_MEDIA_ITEM "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity IN (1, 2)"
-#define SELECT_MEDIA_FROM_MEDIA "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity IN (1, 2) AND media_id='%s'"
-#define SELECT_MEDIA_BY_PATH "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1 AND media_path='%q'"
-#define SELECT_MEDIA_FROM_ALBUM "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity IN (1, 2) AND album_id=%d"
-#define SELECT_MEDIA_FROM_GROUP "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity IN (1, 2) AND %s='%q'"
-#define SELECT_MEDIA_FROM_GROUP_NULL "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity IN (1, 2) AND %s IS NULL"
-#define SELECT_MEDIA_FROM_FOLDER "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity IN (1, 2) AND folder_id='%s'"
-#define SELECT_MEDIA_FROM_STORAGE "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity IN (1, 2) AND storage_uuid='%s'"
-#define SELECT_MEDIA_FROM_TAG "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE media_id IN (SELECT media_id FROM "DB_TABLE_TAG_MAP" WHERE tag_id=%d) AND validity IN (1, 2)"
-#define SELECT_MEDIA_FROM_PLAYLIST "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE media_id IN (SELECT media_id FROM "DB_TABLE_PLAYLIST_MAP" WHERE playlist_id=%d) AND validity IN (1, 2)"
-#define SELECT_MEDIA_PATH_BY_ID "SELECT media_path FROM "DB_VIEW_MEDIA" WHERE media_id='%q'"
-#define SELECT_MEDIA_STORAGE_ID_BY_ID "SELECT storage_uuid FROM "DB_VIEW_MEDIA" WHERE media_id='%q'"
+#define UPDATE_IMAGE_META_FROM_MEDIA "UPDATE "DB_TABLE_MEDIA" SET media_orientation=%d WHERE media_id='%q'"
+
+#define SELECT_MEDIA_ITEM "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
+#define SELECT_MEDIA_ITEM_BY_STORAGE_ID SELECT_MEDIA_ITEM"AND storage_uuid='%s' "
+#define SELECT_MEDIA_FROM_MEDIA "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND media_id='%s'"
+#define SELECT_MEDIA_BY_PATH "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity=1 AND media_path='%q'"
+#define SELECT_MEDIA_FROM_ALBUM "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND album_id=%d"
+#define SELECT_MEDIA_FROM_ALBUM_BY_STORAGE_ID SELECT_MEDIA_FROM_ALBUM" AND storage_uuid='%s' "
+#define SELECT_MEDIA_FROM_GROUP "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND %s='%q'"
+#define SELECT_MEDIA_FROM_GROUP_BY_STORAGE_ID SELECT_MEDIA_FROM_GROUP" AND storage_uuid='%s' "
+#define SELECT_MEDIA_FROM_GROUP_NULL "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND %s IS NULL"
+#define SELECT_MEDIA_FROM_GROUP_NULL_BY_STORAGE_ID SELECT_MEDIA_FROM_GROUP_NULL" AND storage_uuid='%s' "
+#define SELECT_MEDIA_FROM_FOLDER "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND folder_id='%s'"
+#define SELECT_MEDIA_FROM_STORAGE "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND storage_uuid='%s'"
+#define SELECT_MEDIA_FROM_TAG "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE media_id IN (SELECT media_id FROM "DB_TABLE_TAG_MAP" WHERE tag_id=%d) AND validity IN (1, 2)"
+#define SELECT_MEDIA_FROM_PLAYLIST "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE media_id IN (SELECT media_id FROM "DB_TABLE_PLAYLIST_MAP" WHERE playlist_id=%d) AND validity IN (1, 2)"
+#define SELECT_MEDIA_FROM_TAG_BY_STORAGE_ID SELECT_MEDIA_FROM_TAG" AND storage_uuid='%s' "
+#define SELECT_MEDIA_FROM_PLAYLIST_BY_STORAGE_ID SELECT_MEDIA_FROM_PLAYLIST" AND storage_uuid='%s' "
+#define SELECT_MEDIA_PATH_BY_ID "SELECT media_path FROM "DB_TABLE_MEDIA" WHERE media_id='%q'"
+#define SELECT_MEDIA_STORAGE_ID_BY_ID "SELECT storage_uuid FROM "DB_TABLE_MEDIA" WHERE media_id='%q'"
/* Delete */
#define DELETE_PLAYLIST_FROM_PLAYLIST "DELETE FROM "DB_TABLE_PLAYLIST" WHERE playlist_id=%d"
#define DELETE_FACE_FROM_FACE "DELETE FROM "DB_TABLE_FACE" WHERE media_face_id=%d"
#define INSERT_FACE_TO_FACE "INSERT INTO "DB_TABLE_FACE" (media_id, face_rect_x , face_rect_y, face_rect_w, face_rect_h, face_orientation, media_face_tag) VALUES ('%q', %d, %d, %d, %d, %d, %Q);"
#define UPDATE_FACE_TO_FACE "UPDATE "DB_TABLE_FACE" SET face_rect_x=%d, face_rect_y=%d, face_rect_w=%d, face_rect_h=%d, face_orientation=%d, media_face_tag=%Q WHERE media_face_id=%d"
-#define SELECT_MEDIA_COUNT_FROM_MEDIA_BY_ID "SELECT COUNT(*) FROM "DB_VIEW_MEDIA" WHERE media_id='%q' AND validity IN (1, 2)"
-#define SELECT_IMAGE_COUNT_FROM_MEDIA_BY_ID "SELECT COUNT(*) FROM "DB_VIEW_MEDIA" WHERE media_id='%q' AND media_type=0 AND validity IN (1, 2)"
+#define SELECT_MEDIA_COUNT_FROM_MEDIA_BY_ID "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE media_id='%q' AND validity IN (1, 2)"
+#define SELECT_IMAGE_COUNT_FROM_MEDIA_BY_ID "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE media_id='%q' AND media_type=0 AND validity IN (1, 2)"
#define SELECT_FACE_COUNT "SELECT COUNT(*) FROM "FACE_MEDIA_JOIN
+#define SELECT_FACE_COUNT_BY_STORAGE_ID SELECT_FACE_COUNT"AND storage_uuid='%s' "
#define SELECT_FACE_COUNT_BY_MEDIA_ID "SELECT COUNT(*) FROM "FACE_MEDIA_JOIN" AND media_id='%s'"
#define SELECT_FACE_LIST "SELECT media_face_id, media_id, face_rect_x, face_rect_y, face_rect_w, face_rect_h, face_orientation, media_face_tag FROM "FACE_MEDIA_JOIN
+#define SELECT_FACE_LIST_BY_STORAGE_ID SELECT_FACE_LIST"AND storage_uuid='%s' "
#define SELECT_FACE_LIST_BY_MEDIA_ID "SELECT media_face_id, media_id, face_rect_x, face_rect_y, face_rect_w, face_rect_h, face_orientation, media_face_tag FROM "FACE_MEDIA_JOIN" AND media_id='%s'"
#define UPDATE_MEDIA_INFO_IN_FACE_SCAN_LIST "UPDATE "DB_TABLE_FACE_SCAN_LIST" SET modified_time = 0 WHERE media_id IN (SELECT media_id FROM "DB_TABLE_FACE" WHERE media_face_id=%d)"
#define SELECT_FACE_ID "SELECT media_face_id FROM "DB_TABLE_FACE" WHERE media_id='%q' AND face_rect_x=%d AND face_rect_y=%d AND face_rect_w=%d AND face_rect_h=%d AND face_orientation=%d"
int _content_query_sql(char *query_str);
sqlite3 * _content_get_db_handle(void);
uid_t _content_get_uid(void);
-int _media_info_get_media_info_from_db(const char *path, const char *storage_id, media_info_h media);
+int _media_info_get_media_info_from_db(const char *path, media_info_h media);
void _media_info_item_get_detail(sqlite3_stmt *stmt, media_info_h media);
int _media_db_get_group_count(filter_h filter, group_list_e group_type, int *group_count);
int _media_db_get_media_group_count(media_group_e group, filter_h filter, int *group_count);
return ret;
}
+#ifdef _USE_TVPD_MODE
int _media_db_get_group_count(filter_h filter, group_list_e group_type, int *group_count)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
else
snprintf(select_query, sizeof(select_query), SELECT_FACE_COUNT, DB_VIEW_MEDIA);
break;
-#ifdef _USE_TVPD_MODE
case MEDIA_GROUP_PVR:
case MEDIA_GROUP_UHD:
-#endif
default:
{
media_content_error("Invalid group type [%d]", group_type);
filter_s *_filter = (filter_s*)filter;
memset(select_query, 0x00, sizeof(select_query));
-#ifdef _USE_TVPD_MODE
if (group < MEDIA_PVR_GROUP_DURATION) { /*media content*/
if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_COUNT, __media_db_get_group_name(group), _filter->storage_id);
else
snprintf(select_query, sizeof(select_query), SELECT_UHD_GROUP_COUNT, __media_db_get_group_name(group));
}
-#else
- if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
- snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_COUNT, __media_db_get_group_name(group), _filter->storage_id);
- else
- snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_COUNT, __media_db_get_group_name(group), DB_VIEW_MEDIA);
-#endif
ret = __media_db_make_query(filter, select_query, sizeof(select_query), &condition_query, &option_query);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
sqlite3_stmt *stmt = NULL;
filter_s *_filter = (filter_s*)filter;
memset(select_query, 0x00, sizeof(select_query));
-#ifdef _USE_TVPD_MODE
if (group < MEDIA_PVR_GROUP_DURATION) { /*media content */
if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_LIST, __media_db_get_group_name(group), _filter->storage_id);
else
snprintf(select_query, sizeof(select_query), SELECT_UHD_GROUP_LIST, __media_db_get_group_name(group));
}
-#else
- if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
- snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_LIST, __media_db_get_group_name(group), _filter->storage_id);
- else
- snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_LIST, __media_db_get_group_name(group), DB_VIEW_MEDIA);
-#endif
ret = __media_db_make_query(filter, select_query, sizeof(select_query), &condition_query, &option_query);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
return ret;
}
-#ifdef _USE_TVPD_MODE
+
int _media_db_get_media_group_and_count(media_group_e group, filter_h filter, media_group_and_count_cb callback, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
return ret;
}
+#else
+int _media_db_get_group_count(filter_h filter, group_list_e group_type, int *group_count)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ sqlite3_stmt *stmt = NULL;
+ char select_query[MAX_QUERY_SIZE] = {0, };
+ char *condition_query = NULL;
+ char *option_query = NULL;
+ filter_s *_filter = (filter_s*)filter;
+
+ memset(select_query, 0x00, sizeof(select_query));
+
+ switch (group_type) {
+ case MEDIA_GROUP_NONE:
+ case MEDIA_GROUP_TAG_BY_MEDIA_ID:
+ case MEDIA_GROUP_BOOKMARK_BY_MEDIA_ID:
+ case MEDIA_GROUP_FACE_BY_MEDIA_ID:
+ {
+ media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+ return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+ break;
+ case MEDIA_GROUP_ALBUM:
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_ALBUM_COUNT_BY_STORAGE_ID, _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_ALBUM_COUNT);
+
+ break;
+ case MEDIA_GROUP_FOLDER:
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_FOLDER_COUNT_BY_STORAGE_ID, _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_FOLDER_COUNT);
+
+ break;
+ case MEDIA_GROUP_PLAYLIST:
+ if (!SAFE_STRLCPY(select_query, SELECT_PLAYLIST_COUNT, sizeof(select_query))) {
+ media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+ return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+ break;
+ case MEDIA_GROUP_TAG:
+ if (!SAFE_STRLCPY(select_query, SELECT_TAG_COUNT, sizeof(select_query))) {
+ media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+ return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+ break;
+ case MEDIA_GROUP_BOOKMARK:
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_BOOKMARK_COUNT_BY_STORAGE_ID, _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_BOOKMARK_COUNT);
+
+ break;
+ case MEDIA_GROUP_STORAGE:
+ if (!SAFE_STRLCPY(select_query, SELECT_STORAGE_COUNT, sizeof(select_query))) {
+ media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+ return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+ break;
+ case MEDIA_GROUP_FACE:
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_FACE_COUNT_BY_STORAGE_ID, _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_FACE_COUNT);
+ break;
+ default:
+ {
+ media_content_error("Invalid group type [%d]", group_type);
+ return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+ break;
+ }
+
+ ret = __media_db_make_query(filter, select_query, sizeof(select_query), &condition_query, &option_query);
+ media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+ ret = _content_query_prepare(select_query, condition_query, option_query, &stmt);
+ SAFE_FREE(condition_query);
+ SAFE_FREE(option_query);
+ media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+ if (sqlite3_step(stmt) == SQLITE_ROW)
+ *group_count = (int)sqlite3_column_int(stmt, 0);
+
+ SQLITE3_FINALIZE(stmt);
+
+ return ret;
+}
+
+int _media_db_get_media_group_count(media_group_e group, filter_h filter, int *group_count)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ sqlite3_stmt *stmt = NULL;
+ char select_query[MAX_QUERY_SIZE] = {0, };
+ char *condition_query = NULL;
+ char *option_query = NULL;
+ filter_s *_filter = (filter_s*)filter;
+
+ memset(select_query, 0x00, sizeof(select_query));
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_COUNT_BY_STORAGE_ID, __media_db_get_group_name(group), _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_COUNT, __media_db_get_group_name(group));
+
+ ret = __media_db_make_query(filter, select_query, sizeof(select_query), &condition_query, &option_query);
+ media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+ SAFE_STRLCAT(select_query, QUERY_KEYWORD_SPACE, sizeof(select_query));
+ if (STRING_VALID(condition_query))
+ SAFE_STRLCAT(select_query, condition_query, sizeof(select_query));
+ if (STRING_VALID(option_query))
+ SAFE_STRLCAT(select_query, option_query, sizeof(select_query));
+ SAFE_STRLCAT(select_query, QUERY_KEYWORD_BRACKET, sizeof(select_query));
+
+ SAFE_FREE(condition_query);
+ SAFE_FREE(option_query);
+
+ ret = _content_query_prepare(select_query, condition_query, option_query, &stmt);
+ SAFE_FREE(condition_query);
+ SAFE_FREE(option_query);
+ media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+ if (sqlite3_step(stmt) == SQLITE_ROW)
+ *group_count = (int)sqlite3_column_int(stmt, 0);
+
+ SQLITE3_FINALIZE(stmt);
+
+ return ret;
+}
+
+int _media_db_get_media_group(media_group_e group, filter_h filter, media_group_cb callback, void *user_data)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ char select_query[MAX_QUERY_SIZE] = {0, };
+ char *condition_query = NULL;
+ char *option_query = NULL;
+ char *name = NULL;
+ sqlite3_stmt *stmt = NULL;
+ filter_s *_filter = (filter_s*)filter;
+ memset(select_query, 0x00, sizeof(select_query));
+
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_LIST_BY_STORAGE_ID, __media_db_get_group_name(group), _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_LIST, __media_db_get_group_name(group));
+
+ ret = __media_db_make_query(filter, select_query, sizeof(select_query), &condition_query, &option_query);
+ media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+ ret = _content_query_prepare(select_query, condition_query, option_query, &stmt);
+ SAFE_FREE(condition_query);
+ SAFE_FREE(option_query);
+ media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+ while (sqlite3_step(stmt) == SQLITE_ROW) {
+ name = g_strdup((const char *)sqlite3_column_text(stmt, 0));
+
+ if (callback(name, user_data) == false) {
+ SAFE_FREE(name);
+ break;
+ }
+
+ SAFE_FREE(name);
+ }
+
+ SQLITE3_FINALIZE(stmt);
+
+ return ret;
+}
#endif
+
int _media_db_get_album(filter_h filter, media_album_cb callback, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
filter_s *_filter = (filter_s*)filter;
memset(select_query, 0x00, sizeof(select_query));
-
+#ifdef _USE_TVPD_MODE
if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
snprintf(select_query, sizeof(select_query), SELECT_ALBUM_LIST, _filter->storage_id);
else
snprintf(select_query, sizeof(select_query), SELECT_ALBUM_LIST, DB_VIEW_MEDIA);
-
+#else
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_ALBUM_LIST_BY_STORAGE_ID, _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_ALBUM_LIST);
+#endif
ret = __media_db_make_query(filter, select_query, sizeof(select_query), &condition_query, &option_query);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
filter_s *_filter = (filter_s*)filter;
memset(select_query, 0x00, sizeof(select_query));
-
+#ifdef _USE_TVPD_MODE
if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
snprintf(select_query, sizeof(select_query), SELECT_FOLDER_LIST_BY_STORAGE_ID, _filter->storage_id, _filter->storage_id);
else
snprintf(select_query, sizeof(select_query), SELECT_FOLDER_LIST, DB_VIEW_MEDIA);
-
+#else
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_FOLDER_LIST_BY_STORAGE_ID, _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_FOLDER_LIST);
+#endif
ret = __media_db_make_query(filter, select_query, sizeof(select_query), &condition_query, &option_query);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
filter_s *_filter = (filter_s*)filter;
memset(select_query, 0x00, sizeof(select_query));
-
+#ifdef _USE_TVPD_MODE
if (STRING_VALID(media_id)) { //get bookmark by media_id
if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
snprintf(select_query, sizeof(select_query), SELECT_BOOKMARK_LIST_BY_MEDIA_ID, _filter->storage_id, media_id);
else
snprintf(select_query, sizeof(select_query), SELECT_BOOKMARK_LIST, DB_VIEW_MEDIA);
}
+#else
+ if (STRING_VALID(media_id)) { //get bookmark by media_id
+ snprintf(select_query, sizeof(select_query), SELECT_BOOKMARK_LIST_BY_MEDIA_ID, media_id);
+ } else {
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_BOOKMARK_LIST_BY_STORAGE_ID, _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_BOOKMARK_LIST);
+ }
+#endif
ret = __media_db_make_query(filter, select_query, sizeof(select_query), &condition_query, &option_query);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
filter_s *_filter = (filter_s*)filter;
memset(select_query, 0x00, sizeof(select_query));
-
+#ifdef _USE_TVPD_MODE
if (STRING_VALID(media_id)) { //get face by media_id
if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
snprintf(select_query, sizeof(select_query), SELECT_FACE_LIST_BY_MEDIA_ID, _filter->storage_id, media_id);
else
snprintf(select_query, sizeof(select_query), SELECT_FACE_LIST, DB_VIEW_MEDIA);
}
-
+#else
+ if (STRING_VALID(media_id)) { //get face by media_id
+ snprintf(select_query, sizeof(select_query), SELECT_FACE_LIST_BY_MEDIA_ID, media_id);
+ } else {
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_FACE_LIST_BY_STORAGE_ID, _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_FACE_LIST);
+ }
+#endif
ret = __media_db_make_query(filter, select_query, sizeof(select_query), &condition_query, &option_query);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
memset(select_query, 0x00, sizeof(select_query));
if (group_type == MEDIA_GROUP_ALBUM) {
+#ifdef _USE_TVPD_MODE
if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_ALBUM, _filter->storage_id, group_id);
else
snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_ALBUM, DB_VIEW_MEDIA, group_id);
+#else
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_ALBUM_BY_STORAGE_ID, group_id, _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_ALBUM, group_id);
+#endif
} else if (group_type == MEDIA_GROUP_PLAYLIST) {
snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_PLAYLIST, group_id);
} else if (group_type == MEDIA_GROUP_TAG) {
If user wants to set offset and count, use SQL SELECT_MEDIA_COUNT_FROM_MEDIA.
If user wants to get count without setting count, SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE */
if (_filter && ((_filter->offset < 0) && (_filter->count < 0))) {
+#ifdef _USE_TVPD_MODE
if (STRING_VALID(_filter->storage_id))
snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE, _filter->storage_id);
else
snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE, DB_VIEW_MEDIA);
+#else
+ if (STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE_BY_STORAGE_ID, _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE);
+#endif
is_simple = TRUE;
} else {
+#ifdef _USE_TVPD_MODE
snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_MEDIA, DB_VIEW_MEDIA);
+#else
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_MEDIA);
+#endif
}
} else if (group_type == MEDIA_GROUP_FOLDER) {
+#ifdef _USE_TVPD_MODE
if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
tmp_query = sqlite3_mprintf(SELECT_MEDIA_COUNT_FROM_FOLDER, _filter->storage_id, group_name);
else
tmp_query = sqlite3_mprintf(SELECT_MEDIA_COUNT_FROM_FOLDER, DB_VIEW_MEDIA, group_name);
-
+#else
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ tmp_query = sqlite3_mprintf(SELECT_MEDIA_COUNT_FROM_FOLDER_BY_STORAGE_ID, group_name, _filter->storage_id);
+ else
+ tmp_query = sqlite3_mprintf(SELECT_MEDIA_COUNT_FROM_FOLDER, group_name);
+#endif
SAFE_STRLCAT(select_query, tmp_query, sizeof(select_query));
} else if (group_type == MEDIA_GROUP_TAG_BY_MEDIA_ID) {
snprintf(select_query, sizeof(select_query), SELECT_TAG_COUNT_BY_MEDIA_ID, group_name);
} else if (group_type == MEDIA_GROUP_BOOKMARK_BY_MEDIA_ID) {
+#ifdef _USE_TVPD_MODE
if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
tmp_query = sqlite3_mprintf(SELECT_BOOKMARK_COUNT_BY_MEDIA_ID, _filter->storage_id, group_name);
else
tmp_query = sqlite3_mprintf(SELECT_BOOKMARK_COUNT_BY_MEDIA_ID, DB_VIEW_MEDIA, group_name);
-
+#else
+ tmp_query = sqlite3_mprintf(SELECT_BOOKMARK_COUNT_BY_MEDIA_ID, group_name);
+#endif
SAFE_STRLCAT(select_query, tmp_query, sizeof(select_query));
} else if (group_type == MEDIA_GROUP_STORAGE) {
+#ifdef _USE_TVPD_MODE
tmp_query = sqlite3_mprintf(SELECT_MEDIA_COUNT_FROM_STORAGE, group_name, group_name);
-
+#else
+ tmp_query = sqlite3_mprintf(SELECT_MEDIA_COUNT_FROM_STORAGE, group_name);
+#endif
SAFE_STRLCAT(select_query, tmp_query, sizeof(select_query));
} else if (group_type == MEDIA_GROUP_FACE_BY_MEDIA_ID) {
+#ifdef _USE_TVPD_MODE
if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
tmp_query = sqlite3_mprintf(SELECT_FACE_COUNT_BY_MEDIA_ID, _filter->storage_id, group_name);
else
tmp_query = sqlite3_mprintf(SELECT_FACE_COUNT_BY_MEDIA_ID, DB_VIEW_MEDIA, group_name);
-
+#else
+ tmp_query = sqlite3_mprintf(SELECT_FACE_COUNT_BY_MEDIA_ID, group_name);
+#endif
SAFE_STRLCAT(select_query, tmp_query, sizeof(select_query));
#ifdef _USE_TVPD_MODE
} else if (group_type == MEDIA_GROUP_PVR) {
memset(select_query, 0x00, sizeof(select_query));
+#ifdef _USE_TVPD_MODE
if (group_type == MEDIA_GROUP_ALBUM) {
if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_ALBUM, _filter->storage_id, group_id);
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
-
+#else
+ if (group_type == MEDIA_GROUP_ALBUM) {
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_ALBUM_BY_STORAGE_ID, group_id, _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_ALBUM, group_id);
+ } else if (group_type == MEDIA_GROUP_PLAYLIST) {
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_PLAYLIST_BY_STORAGE_ID, group_id, _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_PLAYLIST, group_id);
+ } else if (group_type == MEDIA_GROUP_TAG) {
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_TAG_BY_STORAGE_ID, group_id, _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_TAG, group_id);
+ } else {
+ media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+ return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+#endif
ret = __media_db_make_query(filter, select_query, sizeof(select_query), &condition_query, &option_query);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
filter_s *_filter = (filter_s*)filter;
memset(select_query, 0x00, sizeof(select_query));
-
+#ifdef _USE_TVPD_MODE
if (group_type == MEDIA_GROUP_NONE) {
if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
snprintf(select_query, sizeof(select_query), SELECT_MEDIA_ITEM, _filter->storage_id);
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
-
+#else
+ if (group_type == MEDIA_GROUP_NONE) {
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_ITEM_BY_STORAGE_ID, _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_ITEM);
+ } else if (group_type == MEDIA_GROUP_FOLDER) {
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_FOLDER, group_name);
+ } else if (group_type == MEDIA_GROUP_STORAGE) {
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_STORAGE, group_name);
+ } else {
+ media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+ return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+#endif
ret = __media_db_make_query(filter, select_query, sizeof(select_query), &condition_query, &option_query);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
#else
if (group_name != NULL) {
if ((_filter != NULL) && STRING_VALID(_filter->storage_id)) {
- tmp_query = sqlite3_mprintf(SELECT_MEDIA_COUNT_FROM_GROUP, _filter->storage_id, __media_db_get_group_name(group), group_name);
+ tmp_query = sqlite3_mprintf(SELECT_MEDIA_COUNT_FROM_GROUP_BY_STORAGE_ID, __media_db_get_group_name(group), group_name, _filter->storage_id);
SAFE_STRLCAT(select_query, tmp_query, sizeof(select_query));
} else {
- tmp_query = sqlite3_mprintf(SELECT_MEDIA_COUNT_FROM_GROUP, DB_VIEW_MEDIA, __media_db_get_group_name(group), group_name);
+ tmp_query = sqlite3_mprintf(SELECT_MEDIA_COUNT_FROM_GROUP, __media_db_get_group_name(group), group_name);
SAFE_STRLCAT(select_query, tmp_query, sizeof(select_query));
}
} else {
if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
- snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_GROUP_NULL, _filter->storage_id, __media_db_get_group_name(group));
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_GROUP_NULL_BY_STORAGE_ID, __media_db_get_group_name(group), _filter->storage_id);
else
- snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_GROUP_NULL, DB_VIEW_MEDIA, __media_db_get_group_name(group));
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_GROUP_NULL, __media_db_get_group_name(group));
}
#endif
ret = __media_db_make_query(filter, select_query, sizeof(select_query), &condition_query, &option_query);
filter_s *_filter = (filter_s*)filter;
memset(select_query, 0x00, sizeof(select_query));
-
+#ifdef _USE_TVPD_MODE
if (group_name != NULL) {
if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
tmp_query = sqlite3_mprintf(SELECT_MEDIA_FROM_GROUP, _filter->storage_id, __media_db_get_group_name(group), group_name);
else
snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_GROUP_NULL, DB_VIEW_MEDIA, __media_db_get_group_name(group));
}
+#else
+ if (group_name != NULL) {
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ tmp_query = sqlite3_mprintf(SELECT_MEDIA_FROM_GROUP_BY_STORAGE_ID, __media_db_get_group_name(group), group_name, _filter->storage_id);
+ else
+ tmp_query = sqlite3_mprintf(SELECT_MEDIA_FROM_GROUP, __media_db_get_group_name(group), group_name);
+ SAFE_STRLCAT(select_query, tmp_query, sizeof(select_query));
+ } else {
+ if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_GROUP_NULL_BY_STORAGE_ID, __media_db_get_group_name(group), _filter->storage_id);
+ else
+ snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_GROUP_NULL, __media_db_get_group_name(group));
+ }
+#endif
ret = __media_db_make_query(filter, select_query, sizeof(select_query), &condition_query, &option_query);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
if (tmp_query != NULL)