aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/library/library.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2021-01-09 17:15:37 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2021-01-09 17:15:37 +0000
commit35b2beb4fba153c952b00c6f9adf450520a9c6cf (patch)
tree1145428b100d73ca23e1d3ea06163279aa31d4bd /src/plugins/General/library/library.cpp
parentd3b39e7538baf4d1194c519c5c988d87e10d539b (diff)
downloadqmmp-35b2beb4fba153c952b00c6f9adf450520a9c6cf.tar.gz
qmmp-35b2beb4fba153c952b00c6f9adf450520a9c6cf.tar.bz2
qmmp-35b2beb4fba153c952b00c6f9adf450520a9c6cf.zip
library: added quick search
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9623 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/library/library.cpp')
-rw-r--r--src/plugins/General/library/library.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/General/library/library.cpp b/src/plugins/General/library/library.cpp
index e38309398..ebe36108b 100644
--- a/src/plugins/General/library/library.cpp
+++ b/src/plugins/General/library/library.cpp
@@ -128,7 +128,7 @@ bool Library::createTables()
"Timestamp TIMESTAMP NOT NULL,"
"Title TEXT, Artist TEXT, AlbumArtist TEXT, Album TEXT, Comment TEXT, Genre TEXT, Composer TEXT,"
"Year INTEGER, Track INTEGER, DiscNumer INTEGER, Duration INTEGER, "
- "AudioInfo BLOB, URL TEXT, FilePath TEXT)");
+ "AudioInfo BLOB, URL TEXT, FilePath TEXT, SearchString TEXT)");
if(!ok)
qWarning("Library: unable to create table, error: %s", qPrintable(query.lastError().text()));
@@ -148,7 +148,7 @@ void Library::addTrack(TrackInfo *track, const QString &filePath)
":timestamp, "
":title, :artist, :albumartist, :album, :comment, :genre, :composer, "
":year, :track, :discnumber, :duration, "
- ":audioinfo, :url, :filepath)");
+ ":audioinfo, :url, :filepath, :searchstring)");
query.bindValue(":timestamp", QFileInfo(filePath).lastModified());
query.bindValue(":title", track->value(Qmmp::TITLE));
@@ -165,6 +165,8 @@ void Library::addTrack(TrackInfo *track, const QString &filePath)
query.bindValue(":audioinfo", serializeAudioInfo(track->properties()));
query.bindValue(":url", track->path());
query.bindValue(":filepath", filePath);
+ query.bindValue(":searchstring", QString("%1|||%2|||%3").arg(track->value(Qmmp::ARTIST))
+ .arg(track->value(Qmmp::ALBUM)).arg(track->value(Qmmp::TITLE)).toLower());
if(!query.exec())
qWarning("Library: exec error: %s", qPrintable(query.lastError().text()));
}