diff options
author | Arno <arno@disconnect.de> | 2018-11-03 10:48:38 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2018-11-03 10:48:38 +0100 |
commit | 58f0265365114a8241260d137833437cee3d400b (patch) | |
tree | 1820ad6bc2ae1c0f757e1b2aa8e76dffa2e7eee2 /helper.cpp | |
parent | 40566bc0acc854f7bb49bb67ee816314e2943b38 (diff) | |
download | SheMov-58f0265365114a8241260d137833437cee3d400b.tar.gz SheMov-58f0265365114a8241260d137833437cee3d400b.tar.bz2 SheMov-58f0265365114a8241260d137833437cee3d400b.zip |
Move fuzzyCheck to Helper namespace
Diffstat (limited to 'helper.cpp')
-rw-r--r-- | helper.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -384,6 +384,20 @@ namespace Helper { return PicData(); } + QStringList fuzzyCheck(const QString &subtitle){ + QStringList retval; + QSqlDatabase db = QSqlDatabase::database("treedb"); + db.open(); + QSqlQuery fuzzyQ(db); + fuzzyQ.prepare("SELECT tsubtitle FROM seriesparts WHERE regexp_replace(tsubtitle, '[ .,''!-]', '', 'g') = lower(regexp_replace(:st, '[ .,''!-]', '', 'g'))"); + fuzzyQ.bindValue(":st", subtitle); + fuzzyQ.exec(); + while(fuzzyQ.next()){ + retval << fuzzyQ.value(0).toString(); + } + return retval; + } + Duration::Duration() : mHours(0), mMinutes(0), mSeconds(0) {} Duration::Duration(qint64 seconds){ |