summaryrefslogtreecommitdiffstats
path: root/playerwidget.cpp
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2017-02-27 01:16:45 +0100
committerArno <arno@disconnect.de>2017-02-27 01:16:45 +0100
commitcba00af5348162259eb7909078083edf510853f5 (patch)
tree24a92dcf5dd74e53c8883560951ade910e217759 /playerwidget.cpp
parentebdedb20cf24ed174156aac32711eaa71fb26ef6 (diff)
downloadBeetPlayer-cba00af5348162259eb7909078083edf510853f5.tar.gz
BeetPlayer-cba00af5348162259eb7909078083edf510853f5.tar.bz2
BeetPlayer-cba00af5348162259eb7909078083edf510853f5.zip
Fix filtering
The SQL query for genres was wrong. Copy and Paste error. Also mark songs as songs when filtering.
Diffstat (limited to 'playerwidget.cpp')
-rw-r--r--playerwidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/playerwidget.cpp b/playerwidget.cpp
index f0bb6cf..976da48 100644
--- a/playerwidget.cpp
+++ b/playerwidget.cpp
@@ -219,6 +219,7 @@ void PlayerWidget::populateBySong(QStandardItem *parent, const QString &filter){
curSong->setFont(QFont("courier"));
QString songText = QString(tr("%1 %2 (%3)")).arg(QChar(0x266C)).arg(songQ.value(1).toString()).arg(songQ.value(4).toString());
curSong->setText(songText);
+ curSong->setData(Song, TypeRole);
curSong->setData(songQ.value(0), IdRole);
curSong->setData(songQ.value(2), FullPathRole);
curSong->setData(songQ.value(3), GenreRole);
@@ -246,8 +247,7 @@ void PlayerWidget::populateByGenre(QStandardItem *parent, const QString &filter)
curGenre->setData(genreQ.value(0), IdRole);
root->appendRow(curGenre);
QSqlQuery songQ = QSqlQuery(db);
- //songQ.prepare("SELECT sipos, ttitle, tfullpath, igenres_id, artists.tartists_name FROM songs, artists WHERE igenres_id = :id AND songs.iartists_id = artists.iartists_id ORDER BY ttitle ASC");
- songQ.prepare("SELECT sipos, ttitle, tfullpath, igenres_id, artists.tartists_name, albums.talbum_name FROM songs, artists, albums WHERE ttitle ~ :f AND songs.iartists_id = artists.iartists_id and songs.ialbums_id = albums.ialbums_id ORDER BY ttitle ASC");
+ songQ.prepare("SELECT sipos, ttitle, tfullpath, igenres_id, artists.tartists_name, albums.talbum_name FROM songs, artists, albums WHERE igenres_id = :id AND songs.iartists_id = artists.iartists_id AND songs.ialbums_id = albums.ialbums_id ORDER BY ttitle ASC");
songQ.bindValue(":id", genreQ.value(0));
songQ.exec();
while(songQ.next()){