From c7c99cf98222166b1f832e9838a0508cefa95858 Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Thu, 4 Apr 2019 11:10:04 +0900 Subject: [PATCH] Change path to folder_path in folder table 1. Modify column name 2. Change media, folder join query 3. Remove alias from media and folder table Change-Id: I9019eb9500c4f0d93e50f9fa4d9b316f78169009 Signed-off-by: Minje Ahn --- include/media_info_private.h | 16 ++--- include_product/media_info_private.h | 16 ++--- src/media_content.c | 116 +++++++++++++++++------------------ src/media_db.c | 4 +- 4 files changed, 74 insertions(+), 78 deletions(-) diff --git a/include/media_info_private.h b/include/media_info_private.h index 1299404..da290b5 100755 --- a/include/media_info_private.h +++ b/include/media_info_private.h @@ -429,7 +429,7 @@ typedef struct _media_content_cb_data { /* DB field for folder */ #define DB_FIELD_FOLDER_ID "folder_uuid" -#define DB_FIELD_FOLDER_PATH "path" +#define DB_FIELD_FOLDER_PATH "folder_path" #define DB_FIELD_FOLDER_NAME "name" #define DB_FIELD_FOLDER_STORAGE_TYPE "storage_type" #define DB_FIELD_FOLDER_NAME_PINYIN "name_pinyin" @@ -450,24 +450,24 @@ typedef struct _media_content_cb_data { #define QUERY_KEYWORD_COLLATE "COLLATE " /* DB TABLE JOIN */ -#define FOLDER_MEDIA_JOIN "("DB_TABLE_FOLDER" AS f LEFT OUTER JOIN '%s' AS m ON f.folder_uuid=m.folder_uuid AND m.validity=1) WHERE f.validity=1 " +#define FOLDER_MEDIA_JOIN DB_TABLE_FOLDER" NATURAL LEFT OUTER JOIN '%s' WHERE validity=1 " #define BOOKMARK_MEDIA_JOIN "("DB_TABLE_BOOKMARK" AS b INNER JOIN '%s' AS m ON (b.media_uuid = m.media_uuid)) WHERE validity=1" -#define ALBUM_MEDIA_JOIN DB_TABLE_ALBUM" NATURAL JOIN '%s' WHERE validity=1" +#define ALBUM_MEDIA_JOIN DB_TABLE_ALBUM" NATURAL JOIN '%s' WHERE validity=1 " #define FACE_MEDIA_JOIN "("DB_TABLE_FACE" AS fa INNER JOIN '%s' AS m ON (fa.media_uuid = m.media_uuid)) WHERE validity=1" /* 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=1 " -#define SELECT_FOLDER_LIST "SELECT DISTINCT f.folder_uuid, f.path, f.name, f.storage_type, f.storage_uuid FROM "FOLDER_MEDIA_JOIN -#define SELECT_FOLDER_LIST_BY_STORAGE_ID SELECT_FOLDER_LIST"AND f.storage_uuid='%s' " +#define SELECT_FOLDER_LIST "SELECT DISTINCT folder_uuid, folder_path, name, storage_type, storage_uuid FROM "FOLDER_MEDIA_JOIN +#define SELECT_FOLDER_LIST_BY_STORAGE_ID SELECT_FOLDER_LIST"AND storage_uuid='%s' " #define SELECT_TAG_LIST "SELECT DISTINCT tag_id, tag_name FROM "DB_VIEW_TAG" WHERE 1 " #define SELECT_PLAYLIST_LIST "SELECT DISTINCT playlist_id, playlist_name, p_thumbnail_path FROM "DB_VIEW_PLAYLIST" WHERE 1 " /* Get Group Count */ #define SELECT_ALBUM_COUNT "SELECT COUNT(DISTINCT album_id) FROM "ALBUM_MEDIA_JOIN -#define SELECT_FOLDER_COUNT "SELECT COUNT(DISTINCT f.folder_uuid) FROM "FOLDER_MEDIA_JOIN -#define SELECT_FOLDER_COUNT_BY_STORAGE_ID SELECT_FOLDER_COUNT"AND f.storage_uuid='%s' " +#define SELECT_FOLDER_COUNT "SELECT COUNT(DISTINCT folder_uuid) 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 @@ -487,7 +487,7 @@ typedef struct _media_content_cb_data { /* Get Group Info by Group ID*/ #define SELECT_ALBUM_FROM_ALBUM "SELECT * FROM "DB_TABLE_ALBUM" WHERE album_id=%d" -#define SELECT_FOLDER_FROM_FOLDER "SELECT folder_uuid, path, name, storage_type, storage_uuid FROM "DB_TABLE_FOLDER" WHERE folder_uuid='%s'" +#define SELECT_FOLDER_FROM_FOLDER "SELECT folder_uuid, folder_path, name, storage_type, storage_uuid FROM "DB_TABLE_FOLDER" WHERE folder_uuid='%s'" #define SELECT_PLAYLIST_FROM_PLAYLIST "SELECT playlist_name, thumbnail_path FROM "DB_TABLE_PLAYLIST" WHERE playlist_id=%d" #define SELECT_TAG_FROM_TAG "SELECT tag_name FROM "DB_TABLE_TAG" WHERE tag_id=%d" #define SELECT_TAG_BY_NAME "SELECT tag_id FROM "DB_TABLE_TAG" WHERE tag_name='%q'" diff --git a/include_product/media_info_private.h b/include_product/media_info_private.h index 820a46e..91946eb 100755 --- a/include_product/media_info_private.h +++ b/include_product/media_info_private.h @@ -542,7 +542,7 @@ typedef struct _media_content_scan_cb_data_v2 { /* DB field for folder */ #define DB_FIELD_FOLDER_ID "folder_uuid" -#define DB_FIELD_FOLDER_PATH "path" +#define DB_FIELD_FOLDER_PATH "folder_path" #define DB_FIELD_FOLDER_NAME "name" #define DB_FIELD_FOLDER_STORAGE_TYPE "storage_type" #define DB_FIELD_FOLDER_NAME_PINYIN "name_pinyin" @@ -615,9 +615,9 @@ typedef struct _media_content_scan_cb_data_v2 { #define QUERY_KEYWORD_COLLATE "COLLATE " /* DB TABLE JOIN */ -#define FOLDER_MEDIA_JOIN "("DB_TABLE_FOLDER" AS f LEFT OUTER JOIN '%s' AS m ON f.folder_uuid=m.folder_uuid AND m.validity=1) WHERE f.validity=1 " +#define FOLDER_MEDIA_JOIN DB_TABLE_FOLDER" NATURAL LEFT OUTER JOIN '%s' WHERE validity=1 " #define BOOKMARK_MEDIA_JOIN "("DB_TABLE_BOOKMARK" AS b INNER JOIN '%s' AS m ON (b.media_uuid = m.media_uuid)) WHERE validity=1" -#define ALBUM_MEDIA_JOIN DB_TABLE_ALBUM" NATURAL JOIN '%s' WHERE validity=1" +#define ALBUM_MEDIA_JOIN DB_TABLE_ALBUM" NATURAL JOIN '%s' WHERE validity=1 " #define FACE_MEDIA_JOIN "("DB_TABLE_FACE" AS fa INNER JOIN '%s' AS m ON (fa.media_uuid = m.media_uuid)) WHERE validity=1" /* Get Group info */ @@ -627,15 +627,15 @@ typedef struct _media_content_scan_cb_data_v2 { #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=1 " -#define SELECT_FOLDER_LIST "SELECT DISTINCT f.folder_uuid, f.path, f.name, f.storage_type, f.storage_uuid FROM "FOLDER_MEDIA_JOIN -#define SELECT_FOLDER_LIST_BY_STORAGE_ID SELECT_FOLDER_LIST"AND f.storage_uuid='%s' " +#define SELECT_FOLDER_LIST "SELECT DISTINCT folder_uuid, folder_path, name, storage_type, storage_uuid FROM "FOLDER_MEDIA_JOIN +#define SELECT_FOLDER_LIST_BY_STORAGE_ID SELECT_FOLDER_LIST"AND storage_uuid='%s' " #define SELECT_TAG_LIST "SELECT DISTINCT tag_id, tag_name FROM "DB_VIEW_TAG" WHERE 1 " #define SELECT_PLAYLIST_LIST "SELECT DISTINCT playlist_id, playlist_name, p_thumbnail_path FROM "DB_VIEW_PLAYLIST" WHERE 1 " /* Get Group Count */ #define SELECT_ALBUM_COUNT "SELECT COUNT(DISTINCT album_id) FROM "ALBUM_MEDIA_JOIN -#define SELECT_FOLDER_COUNT "SELECT COUNT(DISTINCT f.folder_uuid) FROM "FOLDER_MEDIA_JOIN -#define SELECT_FOLDER_COUNT_BY_STORAGE_ID SELECT_FOLDER_COUNT"AND f.storage_uuid='%s' " +#define SELECT_FOLDER_COUNT "SELECT COUNT(DISTINCT folder_uuid) 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 @@ -655,7 +655,7 @@ typedef struct _media_content_scan_cb_data_v2 { /* Get Group Info by Group ID*/ #define SELECT_ALBUM_FROM_ALBUM "SELECT * FROM "DB_TABLE_ALBUM" WHERE album_id=%d" -#define SELECT_FOLDER_FROM_FOLDER "SELECT folder_uuid, path, name, storage_type, storage_uuid FROM "DB_TABLE_FOLDER" WHERE folder_uuid='%s'" +#define SELECT_FOLDER_FROM_FOLDER "SELECT folder_uuid, folder_path, name, storage_type, storage_uuid FROM "DB_TABLE_FOLDER" WHERE folder_uuid='%s'" #define SELECT_PLAYLIST_FROM_PLAYLIST "SELECT playlist_name, thumbnail_path FROM "DB_TABLE_PLAYLIST" WHERE playlist_id=%d" #define SELECT_TAG_FROM_TAG "SELECT tag_name FROM "DB_TABLE_TAG" WHERE tag_id=%d" #define SELECT_TAG_BY_NAME "SELECT tag_id FROM "DB_TABLE_TAG" WHERE tag_name='%q'" diff --git a/src/media_content.c b/src/media_content.c index cd7b52c..8dd36c6 100755 --- a/src/media_content.c +++ b/src/media_content.c @@ -37,76 +37,75 @@ typedef struct { static media_content_attribute_info_s g_content_attrs_info[] = { /* Media Info */ - {MEDIA_ID, DB_FIELD_MEDIA_ID, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ID}, - {MEDIA_PATH, DB_FIELD_MEDIA_PATH, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_PATH}, - {MEDIA_DISPLAY_NAME, DB_FIELD_MEDIA_DISPLAY_NAME, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_DISPLAY_NAME}, - {MEDIA_TYPE, DB_FIELD_MEDIA_TYPE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_TYPE}, - {MEDIA_MIME_TYPE, DB_FIELD_MEDIA_MIME_TYPE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_MIME_TYPE}, - {MEDIA_SIZE, DB_FIELD_MEDIA_SIZE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_SIZE}, - {MEDIA_ADDED_TIME, DB_FIELD_MEDIA_ADDED_TIME, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ADDED_TIME}, - {MEDIA_MODIFIED_TIME, DB_FIELD_MEDIA_MODIFIED_TIME, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_MODIFIED_TIME}, - {MEDIA_TIMELINE, DB_FIELD_MEDIA_TIMELINE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_TIMELINE}, - {MEDIA_THUMBNAIL_PATH, DB_FIELD_MEDIA_THUMBNAIL_PATH, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_THUMBNAIL_PATH}, - {MEDIA_TITLE, DB_FIELD_MEDIA_TITLE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_TITLE}, - {MEDIA_ALBUM, DB_FIELD_MEDIA_ALBUM, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ALBUM}, - {MEDIA_ARTIST, DB_FIELD_MEDIA_ARTIST, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ARTIST}, - {MEDIA_ALBUM_ARTIST, DB_FIELD_MEDIA_ALBUM_ARTIST, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ALBUM_ARTIST}, - {MEDIA_GENRE, DB_FIELD_MEDIA_GENRE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_GENRE}, - {MEDIA_COMPOSER, DB_FIELD_MEDIA_COMPOSER, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_COMPOSER}, - {MEDIA_YEAR, DB_FIELD_MEDIA_YEAR, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_YEAR}, - {MEDIA_RECORDED_DATE, DB_FIELD_MEDIA_RECORDED_DATE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_RECORDED_DATE}, - {MEDIA_COPYRIGHT, DB_FIELD_MEDIA_COPYRIGHT, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_COPYRIGHT}, - {MEDIA_TRACK_NUM, DB_FIELD_MEDIA_TRACK_NUM, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_TRACK_NUM}, - {MEDIA_DESCRIPTION, DB_FIELD_MEDIA_DESCRIPTION, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_DESCRIPTION}, - {MEDIA_BITRATE, DB_FIELD_MEDIA_BITRATE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_BITRATE}, - {MEDIA_BITPERSAMPLE, DB_FIELD_MEDIA_BITPERSAMPLE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_BITPERSAMPLE}, - {MEDIA_SAMPLERATE, DB_FIELD_MEDIA_SAMPLERATE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_SAMPLERATE}, - {MEDIA_CHANNEL, DB_FIELD_MEDIA_CHANNEL, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_CHANNEL}, - {MEDIA_DURATION, DB_FIELD_MEDIA_DURATION, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_DURATION}, - {MEDIA_LONGITUDE, DB_FIELD_MEDIA_LONGITUDE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LONGITUDE}, - {MEDIA_LATITUDE, DB_FIELD_MEDIA_LATITUDE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LATITUDE}, - {MEDIA_ALTITUDE, DB_FIELD_MEDIA_ALTITUDE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ALTITUDE}, - {MEDIA_WIDTH, DB_FIELD_MEDIA_WIDTH, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_WIDTH}, - {MEDIA_HEIGHT, DB_FIELD_MEDIA_HEIGHT, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_HEIGHT}, - {MEDIA_DATETAKEN, DB_FIELD_MEDIA_DATETAKEN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_DATETAKEN}, - {MEDIA_ORIENTATION, DB_FIELD_MEDIA_ORIENTATION, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ORIENTATION}, - {MEDIA_RATING, DB_FIELD_MEDIA_RATING, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_RATING}, - {MEDIA_FAVOURITE, DB_FIELD_MEDIA_FAVOURITE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_FAVOURITE}, - {MEDIA_IS_DRM, DB_FIELD_MEDIA_IS_DRM, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_IS_DRM}, - {MEDIA_STORAGE_TYPE, DB_FIELD_MEDIA_STORAGE_TYPE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_STORAGE_TYPE}, - {MEDIA_360, DB_FIELD_MEDIA_360, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_360}, + {MEDIA_ID, DB_FIELD_MEDIA_ID, NULL}, + {MEDIA_PATH, DB_FIELD_MEDIA_PATH, NULL}, + {MEDIA_DISPLAY_NAME, DB_FIELD_MEDIA_DISPLAY_NAME, NULL}, + {MEDIA_TYPE, DB_FIELD_MEDIA_TYPE, NULL}, + {MEDIA_MIME_TYPE, DB_FIELD_MEDIA_MIME_TYPE, NULL}, + {MEDIA_SIZE, DB_FIELD_MEDIA_SIZE, NULL}, + {MEDIA_ADDED_TIME, DB_FIELD_MEDIA_ADDED_TIME, NULL}, + {MEDIA_MODIFIED_TIME, DB_FIELD_MEDIA_MODIFIED_TIME, NULL}, + {MEDIA_TIMELINE, DB_FIELD_MEDIA_TIMELINE, NULL}, + {MEDIA_THUMBNAIL_PATH, DB_FIELD_MEDIA_THUMBNAIL_PATH, NULL}, + {MEDIA_TITLE, DB_FIELD_MEDIA_TITLE, NULL}, + {MEDIA_ALBUM, DB_FIELD_MEDIA_ALBUM, NULL}, + {MEDIA_ARTIST, DB_FIELD_MEDIA_ARTIST, NULL}, + {MEDIA_ALBUM_ARTIST, DB_FIELD_MEDIA_ALBUM_ARTIST, NULL}, + {MEDIA_GENRE, DB_FIELD_MEDIA_GENRE, NULL}, + {MEDIA_COMPOSER, DB_FIELD_MEDIA_COMPOSER, NULL}, + {MEDIA_YEAR, DB_FIELD_MEDIA_YEAR, NULL}, + {MEDIA_RECORDED_DATE, DB_FIELD_MEDIA_RECORDED_DATE, NULL}, + {MEDIA_COPYRIGHT, DB_FIELD_MEDIA_COPYRIGHT, NULL}, + {MEDIA_TRACK_NUM, DB_FIELD_MEDIA_TRACK_NUM, NULL}, + {MEDIA_DESCRIPTION, DB_FIELD_MEDIA_DESCRIPTION, NULL}, + {MEDIA_BITRATE, DB_FIELD_MEDIA_BITRATE, NULL}, + {MEDIA_BITPERSAMPLE, DB_FIELD_MEDIA_BITPERSAMPLE, NULL}, + {MEDIA_SAMPLERATE, DB_FIELD_MEDIA_SAMPLERATE, NULL}, + {MEDIA_CHANNEL, DB_FIELD_MEDIA_CHANNEL, NULL}, + {MEDIA_DURATION, DB_FIELD_MEDIA_DURATION, NULL}, + {MEDIA_LONGITUDE, DB_FIELD_MEDIA_LONGITUDE, NULL}, + {MEDIA_LATITUDE, DB_FIELD_MEDIA_LATITUDE, NULL}, + {MEDIA_ALTITUDE, DB_FIELD_MEDIA_ALTITUDE, NULL}, + {MEDIA_WIDTH, DB_FIELD_MEDIA_WIDTH, NULL}, + {MEDIA_HEIGHT, DB_FIELD_MEDIA_HEIGHT, NULL}, + {MEDIA_DATETAKEN, DB_FIELD_MEDIA_DATETAKEN, NULL}, + {MEDIA_ORIENTATION, DB_FIELD_MEDIA_ORIENTATION, NULL}, + {MEDIA_RATING, DB_FIELD_MEDIA_RATING, NULL}, + {MEDIA_FAVOURITE, DB_FIELD_MEDIA_FAVOURITE, NULL}, + {MEDIA_IS_DRM, DB_FIELD_MEDIA_IS_DRM, NULL}, + {MEDIA_STORAGE_TYPE, DB_FIELD_MEDIA_STORAGE_TYPE, NULL}, + {MEDIA_360, DB_FIELD_MEDIA_360, NULL}, /* Pinyin */ - {MEDIA_FILE_NAME_PINYIN, DB_FIELD_MEDIA_FILE_NAME_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_FILE_NAME_PINYIN}, - {MEDIA_TITLE_PINYIN, DB_FIELD_MEDIA_TITLE_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_TITLE_PINYIN}, - {MEDIA_ALBUM_PINYIN, DB_FIELD_MEDIA_ALBUM_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ALBUM_PINYIN}, - {MEDIA_ARTIST_PINYIN, DB_FIELD_MEDIA_ARTIST_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ARTIST_PINYIN}, - {MEDIA_ALBUM_ARTIST_PINYIN, DB_FIELD_MEDIA_ALBUM_ARTIST_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ALBUM_ARTIST_PINYIN}, - {MEDIA_GENRE_PINYIN, DB_FIELD_MEDIA_GENRE_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_GENRE_PINYIN}, - {MEDIA_COMPOSER_PINYIN, DB_FIELD_MEDIA_COMPOSER_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_COMPOSER_PINYIN}, - {MEDIA_COPYRIGHT_PINYIN, DB_FIELD_MEDIA_COPYRIGHT_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_COPYRIGHT_PINYIN}, - {MEDIA_DESCRIPTION_PINYIN, DB_FIELD_MEDIA_DESCRIPTION_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_DESCRIPTION_PINYIN}, + {MEDIA_FILE_NAME_PINYIN, DB_FIELD_MEDIA_FILE_NAME_PINYIN, NULL}, + {MEDIA_TITLE_PINYIN, DB_FIELD_MEDIA_TITLE_PINYIN, NULL}, + {MEDIA_ALBUM_PINYIN, DB_FIELD_MEDIA_ALBUM_PINYIN, NULL}, + {MEDIA_ARTIST_PINYIN, DB_FIELD_MEDIA_ARTIST_PINYIN, NULL}, + {MEDIA_ALBUM_ARTIST_PINYIN, DB_FIELD_MEDIA_ALBUM_ARTIST_PINYIN, NULL}, + {MEDIA_GENRE_PINYIN, DB_FIELD_MEDIA_GENRE_PINYIN, NULL}, + {MEDIA_COMPOSER_PINYIN, DB_FIELD_MEDIA_COMPOSER_PINYIN, NULL}, + {MEDIA_COPYRIGHT_PINYIN, DB_FIELD_MEDIA_COPYRIGHT_PINYIN, NULL}, + {MEDIA_DESCRIPTION_PINYIN, DB_FIELD_MEDIA_DESCRIPTION_PINYIN, NULL}, /* Folder */ - {FOLDER_ID, NULL, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_ID}, - {FOLDER_PATH, NULL, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_PATH}, - {FOLDER_NAME, NULL, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_NAME}, - {FOLDER_STORAGE_TYPE, NULL, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_STORAGE_TYPE}, - {FOLDER_NAME_PINYIN, NULL, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_NAME_PINYIN}, + {FOLDER_ID, DB_FIELD_FOLDER_ID, NULL}, + {FOLDER_NAME, DB_FIELD_FOLDER_NAME, NULL}, + {FOLDER_STORAGE_TYPE, DB_FIELD_FOLDER_STORAGE_TYPE, NULL}, + {FOLDER_NAME_PINYIN, DB_FIELD_FOLDER_NAME_PINYIN, NULL}, /* Storage */ {MEDIA_STORAGE_ID, DB_FIELD_STORAGE_ID, NULL}, {MEDIA_STORAGE_PATH, DB_FIELD_STORAGE_PATH, NULL}, #ifdef _USE_SENIOR_MODE - {MEDIA_CONTACT, DB_FIELD_MEDIA_CONTACT, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_CONTACT}, - {MEDIA_APP_DATA, DB_FIELD_MEDIA_APP_DATA, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_APP_DATA}, + {MEDIA_CONTACT, DB_FIELD_MEDIA_CONTACT, NULL}, + {MEDIA_APP_DATA, DB_FIELD_MEDIA_APP_DATA, NULL}, #endif #ifdef _USE_TVPD_MODE - {MEDIA_PLAYED_COUNT, DB_FIELD_MEDIA_PLAYED_COUNT, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_PLAYED_COUNT}, - {MEDIA_LAST_PLAYED_TIME, DB_FIELD_MEDIA_LAST_PLAYED_TIME, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LAST_PLAYED_TIME}, - {MEDIA_LAST_PLAYED_POSITION, DB_FIELD_MEDIA_LAST_PLAYED_POSITION, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LAST_PLAYED_POSITION}, - {MEDIA_FOLDER_ID, DB_FIELD_MEDIA_FOLDER_ID, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_FOLDER_ID}, + {MEDIA_PLAYED_COUNT, DB_FIELD_MEDIA_PLAYED_COUNT, NULL}, + {MEDIA_LAST_PLAYED_TIME, DB_FIELD_MEDIA_LAST_PLAYED_TIME, NULL}, + {MEDIA_LAST_PLAYED_POSITION, DB_FIELD_MEDIA_LAST_PLAYED_POSITION, NULL}, + {MEDIA_FOLDER_ID, DB_FIELD_MEDIA_FOLDER_ID, NULL}, {MEDIA_STITCHED_INFO, DB_FIELD_MEDIA_STITCHED_INFO, NULL}, {MEDIA_MODIFIED_MONTH, DB_FIELD_MEDIA_MODIFIED_MONTH, NULL}, {MEDIA_MODIFIED_DATE, DB_FIELD_MEDIA_MODIFIED_DATE, NULL}, @@ -265,7 +264,6 @@ attribute_h _content_get_attirbute_handle(void) attribute_h _content_get_alias_attirbute_handle(void) { - /* This API use only folder query */ return g_alias_attr_handle; } diff --git a/src/media_db.c b/src/media_db.c index f63d1c0..a2bdb91 100755 --- a/src/media_db.c +++ b/src/media_db.c @@ -251,8 +251,6 @@ int _media_db_get_group_count(filter_h filter, group_list_e group_type, int *gro break; case MEDIA_GROUP_FOLDER: - attr = _content_get_alias_attirbute_handle(); - if ((_filter != NULL) && STRING_VALID(_filter->storage_id)) snprintf(select_query, sizeof(select_query), SELECT_FOLDER_COUNT_BY_STORAGE_ID, _filter->storage_id, _filter->storage_id); else @@ -571,7 +569,7 @@ int _media_db_get_folder(filter_h filter, media_folder_cb callback, void *user_d attribute_h attr = NULL; filter_s *_filter = (filter_s*)filter; - attr = _content_get_alias_attirbute_handle(); + attr = _content_get_attirbute_handle(); memset(select_query, 0x00, sizeof(select_query)); if ((_filter != NULL) && STRING_VALID(_filter->storage_id)) -- 2.7.4