/* 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_PLAYLIST_FROM_PLAYLIST "SELECT * FROM "DB_TABLE_PLAYLIST" WHERE playlist_id=%d"
-#define SELECT_TAG_FROM_TAG "SELECT * FROM "DB_TABLE_TAG" WHERE tag_id=%d"
-#define SELECT_TAG_BY_NAME "SELECT * FROM "DB_TABLE_TAG" WHERE name='%q'"
+#define SELECT_PLAYLIST_FROM_PLAYLIST "SELECT name, thumbnail_path FROM "DB_TABLE_PLAYLIST" WHERE playlist_id=%d"
+#define SELECT_TAG_FROM_TAG "SELECT name FROM "DB_TABLE_TAG" WHERE tag_id=%d"
+#define SELECT_TAG_BY_NAME "SELECT tag_id FROM "DB_TABLE_TAG" WHERE name='%q'"
/* Tag info*/
#define INSERT_TAG_TO_TAG "INSERT INTO "DB_TABLE_TAG" (name) VALUES (%Q)"
/* 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_PLAYLIST_FROM_PLAYLIST "SELECT * FROM "DB_TABLE_PLAYLIST" WHERE playlist_id=%d"
-#define SELECT_TAG_FROM_TAG "SELECT * FROM "DB_TABLE_TAG" WHERE tag_id=%d"
-#define SELECT_TAG_BY_NAME "SELECT * FROM "DB_TABLE_TAG" WHERE name='%q'"
+#define SELECT_PLAYLIST_FROM_PLAYLIST "SELECT name, thumbnail_path FROM "DB_TABLE_PLAYLIST" WHERE playlist_id=%d"
+#define SELECT_TAG_FROM_TAG "SELECT name FROM "DB_TABLE_TAG" WHERE tag_id=%d"
+#define SELECT_TAG_BY_NAME "SELECT tag_id FROM "DB_TABLE_TAG" WHERE name='%q'"
/* Tag info*/
#define INSERT_TAG_TO_TAG "INSERT INTO "DB_TABLE_TAG" (name) VALUES (%Q)"
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
- _playlist->playlist_id = (int)sqlite3_column_int(stmt, 0);
- _playlist->name = g_strdup((const char *)sqlite3_column_text(stmt, 1));
- _playlist->thumbnail_path = g_strdup((const char *)sqlite3_column_text(stmt, 3));
+ _playlist->playlist_id = playlist_id;
+ _playlist->name = g_strdup((const char *)sqlite3_column_text(stmt, 0));
+ _playlist->thumbnail_path = g_strdup((const char *)sqlite3_column_text(stmt, 1));
*playlist = (media_playlist_h)_playlist;
} else {
if (sqlite3_step(stmt) == SQLITE_ROW) {
_tag->tag_id = (int)sqlite3_column_int(stmt, 0);
- _tag->name = g_strdup((const char *)sqlite3_column_text(stmt, 1));
+ _tag->name = g_strdup(name);
} else {
media_content_error("Nonexistent tag name[%s]", name);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
- _tag->tag_id = (int)sqlite3_column_int(stmt, 0);
- _tag->name = g_strdup((const char *)sqlite3_column_text(stmt, 1));
+ _tag->tag_id = tag_id;
+ _tag->name = g_strdup((const char *)sqlite3_column_text(stmt, 0));
*tag = (media_tag_h)_tag;
} else {