This commit is contained in:
2016-10-21 16:52:16 +02:00
parent d0fb64f414
commit d140bae224
5 changed files with 174 additions and 8 deletions
+44 -6
View File
@@ -6,6 +6,9 @@
#include <QSqlQuery>
#include <QDebug>
#include <QTime>
cKodiVideoLibrary::cKodiVideoLibrary(const QString& szFileName) :
m_szFileName(szFileName),
@@ -58,15 +61,50 @@ qint16 cKodiVideoLibrary::version()
qint32 cKodiVideoLibrary::load()
{
QStringList movies;
QSqlQuery query(m_db);
query.exec("SELECT idMovie, idFile, c00 FROM movie_view ORDER BY c00;");
query.exec("SELECT idMovie, idFile, c00, c01, c02, c03, c04, c05, c06, c07, c08, c09, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, idSet, userrating, strSet, strSetOverview, strFileName, strPath, playCount, lastPlayed, dateAdded, resumeTimeInSeconds, totalTimeInSeconds FROM movie_view ORDER BY c00;");
while(query.next())
{
movies.append(query.value("c00").toString());
}
cMyVideos* lpNew = m_videosList.add(
query.value("idMovie").toInt(),
query.value("idFile").toInt(),
query.value("c00").toString(),
query.value("c01").toString(),
query.value("c02").toString(),
query.value("c03").toString(),
query.value("c04").toInt(),
query.value("c05").toDouble(),
query.value("c06").toString(),
query.value("c07").toInt(),
query.value("c08").toString(),
query.value("c09").toString(),
query.value("c10").toString(),
query.value("c11").toInt(),
query.value("c12").toString(),
query.value("c13").toString(),
query.value("c14").toString(),
query.value("c15").toString(),
query.value("c16").toString(),
query.value("c18").toString(),
query.value("c19").toString(),
query.value("c20").toString(),
query.value("c21").toString(),
query.value("c22").toString(),
query.value("c23").toInt(),
query.value("idSet").toInt(),
query.value("userrating").toInt(),
query.value("strSet").toString(),
query.value("strSetOverview").toString(),
query.value("strFileName").toString(),
query.value("strPath").toString(),
query.value("playCount").toInt(),
QDateTime::fromString(query.value("lastPlayed").toString(), "yyyy-MM-dd HH:mm:ss"),
QDateTime::fromString(query.value("dateAdded").toString(), "yyyy-MM-dd HH:mm:ss"),
query.value("resumeTimeInSeconds").toDouble(),
query.value("totalTimeInSeconds").toDouble());
return(movies.count());
lpNew = 0;
}
return(m_videosList.count());
}