diff options
author | RaK <RaK@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-02-01 22:35:23 +0000 |
---|---|---|
committer | RaK <RaK@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-02-01 22:35:23 +0000 |
commit | 4dd57316383cafcb54b1d8de9cf845f716f479be (patch) | |
tree | fb426f568a3ffbe15906482e509176dd6bd7d4d3 /muggle-plugin/gd_content_interface.c | |
parent | abfc554e5ef67d1c286eb3863a55702a7fd37f73 (diff) | |
download | vdr-plugin-muggle-4dd57316383cafcb54b1d8de9cf845f716f479be.tar.gz vdr-plugin-muggle-4dd57316383cafcb54b1d8de9cf845f716f479be.tar.bz2 |
Added View Artist -> Tracks
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk@12 e10066b5-e1e2-0310-b819-94efdf66514b
Diffstat (limited to 'muggle-plugin/gd_content_interface.c')
-rw-r--r-- | muggle-plugin/gd_content_interface.c | 72 |
1 files changed, 67 insertions, 5 deletions
diff --git a/muggle-plugin/gd_content_interface.c b/muggle-plugin/gd_content_interface.c index becae1c..f3f1b47 100644 --- a/muggle-plugin/gd_content_interface.c +++ b/muggle-plugin/gd_content_interface.c @@ -3,8 +3,8 @@ * \brief Data Objects for content (e.g. mp3 files, movies) * for the vdr muggle plugindatabase ******************************************************************** - * \version $Revision: 1.2 $ - * \date $Date: 2004/02/01 22:12:56 $ + * \version $Revision: 1.3 $ + * \date $Date: 2004/02/01 22:35:23 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner * \author file owner: $Author: RaK $ * @@ -40,7 +40,7 @@ int GdInitDatabase(MYSQL *db) } if(mysql_real_connect(db,"localhost","root","", - "GiantDisc",0,NULL,0) == NULL) + "GiantDisc2",0,NULL,0) == NULL) { return -2; } @@ -795,7 +795,9 @@ bool GdTreeNode::expand() idfield = "album.artist"; } else if(m_level == 3) { // genre -> artist -> album sprintf(sqlbuff, - "SELECT DISTINCT album.title,tracks.sourceid" + "SELECT DISTINCT" + " album.title," + " tracks.sourceid" " FROM tracks,genre,album" " WHERE (genre.id=tracks.genre1) AND" " (album.cddbid=tracks.sourceid) AND" @@ -881,7 +883,62 @@ bool GdTreeNode::expand() return false; } break; - default: + case 5: // Album -> Tracks + if(m_level == 1) { // Album + sprintf(sqlbuff, + "SELECT DISTINCT" + " CONCAT(album.artist,' - ',album.title) AS title," + " album.cddbid" + " FROM album" + " WHERE 1 AND" + " %s" + " ORDER BY title" + , m_restriction.c_str()); + idfield = "tracks.genre1"; + } else if (m_level == 2) { // + sprintf(sqlbuff, + "SELECT DISTINCT tracks.title, tracks.id" + " FROM tracks,genre,album" + " WHERE (genre.id=tracks.genre1) AND" + " (album.cddbid=tracks.sourceid) AND" + " %s" + " ORDER BY tracks.tracknb" + , m_restriction.c_str()); + idfield = "tracks.id"; + } else { + mgWarning("View #%d level %d' not yet implemented", m_view, m_level); + m_expanded = false; + return false; + } + case 100: + if (m_level == 1) { + sprintf(sqlbuff, + "SELECT DISTINCT" + " CONCAT(album.artist,' - ',album.title) as title," + " album.cddbid" + " FROM album,genre" + " WHERE " + " %s" + " ORDER BY title" + , m_restriction.c_str()); + idfield = "tracks.sourceid"; + } else if (m_level == 2) { + sprintf(sqlbuff, + "SELECT tracks.title,tracks.id" + " FROM tracks,genre,album" + " WHERE (genre.id=tracks.genre1) AND" + " (album.cddbid=tracks.sourceid) AND" + " %s" + " ORDER BY tracks.tracknb" + , m_restriction.c_str()); + idfield = "tracks.id"; + } else { + mgWarning("View #%d level %d' not yet implemented", m_view, m_level); + m_expanded = false; + return false; + } + break; +default: mgError("View '%d' not yet implemented", m_view); } @@ -928,6 +985,11 @@ bool GdTreeNode::expand() "Genre -> Year -> Track" , // label, "1"); m_children.push_back(new_child); + new_child = new GdTreeNode(this, // parent + "5" , // id + "Album -> Track" , // label, + "1"); + m_children.push_back(new_child); } else { new_child = new GdTreeNode(this, // parent "100" , // id |