mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 00:58:32 -04:00
Add original cover size to the comic_info table.
This commit is contained in:
parent
4c91da82a9
commit
ffd9631b72
@ -181,9 +181,10 @@ bool DataBaseManagement::createTables(QSqlDatabase & database)
|
|||||||
"gamma INTEGER DEFAULT -1, "
|
"gamma INTEGER DEFAULT -1, "
|
||||||
//new 7.1 fields
|
//new 7.1 fields
|
||||||
"comicVineID TEXT,"
|
"comicVineID TEXT,"
|
||||||
//new 8.6 fields
|
//new 9.5 fields
|
||||||
"lastTimeOpened INTEGER,"
|
"lastTimeOpened INTEGER,"
|
||||||
"coverSizeRatio REAL" //h/w
|
"coverSizeRatio REAL,"
|
||||||
|
"originalCoverSize STRING"//h/w
|
||||||
|
|
||||||
")");
|
")");
|
||||||
success = success && queryComicInfo.exec();
|
success = success && queryComicInfo.exec();
|
||||||
@ -199,7 +200,7 @@ bool DataBaseManagement::createTables(QSqlDatabase & database)
|
|||||||
//new 7.1 fields
|
//new 7.1 fields
|
||||||
"finished BOOLEAN DEFAULT 0," //reading
|
"finished BOOLEAN DEFAULT 0," //reading
|
||||||
"completed BOOLEAN DEFAULT 1," //collecting
|
"completed BOOLEAN DEFAULT 1," //collecting
|
||||||
//new 8.6 fields
|
//new 9.5 fields
|
||||||
"numChildren INTEGER,"
|
"numChildren INTEGER,"
|
||||||
"firstChildHash TEXT,"
|
"firstChildHash TEXT,"
|
||||||
"customImage TEXT,"
|
"customImage TEXT,"
|
||||||
@ -425,7 +426,8 @@ bool DataBaseManagement::importComicsInfo(QString source, QString dest)
|
|||||||
|
|
||||||
"lastTimeOpened = :lastTimeOpened,"
|
"lastTimeOpened = :lastTimeOpened,"
|
||||||
|
|
||||||
"coverSizeRatio = :coverSizeRatio"
|
"coverSizeRatio = :coverSizeRatio,"
|
||||||
|
"originalCoverSize = :originalCoverSize"
|
||||||
|
|
||||||
" WHERE hash = :hash ");
|
" WHERE hash = :hash ");
|
||||||
|
|
||||||
@ -501,6 +503,7 @@ bool DataBaseManagement::importComicsInfo(QString source, QString dest)
|
|||||||
":lastTimeOpened,"
|
":lastTimeOpened,"
|
||||||
|
|
||||||
":coverSizeRatio,"
|
":coverSizeRatio,"
|
||||||
|
":originalCoverSize,"
|
||||||
|
|
||||||
":hash )");
|
":hash )");
|
||||||
|
|
||||||
@ -615,6 +618,7 @@ void DataBaseManagement::bindValuesFromRecord(const QSqlRecord & record, QSqlQue
|
|||||||
bindString("lastTimeOpened",record,query);
|
bindString("lastTimeOpened",record,query);
|
||||||
|
|
||||||
bindDouble("coverSizeRatio",record,query);
|
bindDouble("coverSizeRatio",record,query);
|
||||||
|
bindString("originalCoverSize",record,query);
|
||||||
|
|
||||||
bindString("hash",record,query);
|
bindString("hash",record,query);
|
||||||
}
|
}
|
||||||
@ -727,7 +731,7 @@ bool DataBaseManagement::updateToCurrentVersion(const QString & fullPath)
|
|||||||
bool pre7 = false;
|
bool pre7 = false;
|
||||||
bool pre7_1 = false;
|
bool pre7_1 = false;
|
||||||
bool pre8 = false;
|
bool pre8 = false;
|
||||||
bool pre8_6 = false;
|
bool pre9_5 = false;
|
||||||
|
|
||||||
if(compareVersions(DataBaseManagement::checkValidDB(fullPath),"7.0.0")<0)
|
if(compareVersions(DataBaseManagement::checkValidDB(fullPath),"7.0.0")<0)
|
||||||
pre7 = true;
|
pre7 = true;
|
||||||
@ -735,8 +739,8 @@ bool DataBaseManagement::updateToCurrentVersion(const QString & fullPath)
|
|||||||
pre7_1 = true;
|
pre7_1 = true;
|
||||||
if(compareVersions(DataBaseManagement::checkValidDB(fullPath),"8.0.0")<0)
|
if(compareVersions(DataBaseManagement::checkValidDB(fullPath),"8.0.0")<0)
|
||||||
pre8 = true;
|
pre8 = true;
|
||||||
if(compareVersions(DataBaseManagement::checkValidDB(fullPath),"8.6.0")<0)
|
if(compareVersions(DataBaseManagement::checkValidDB(fullPath),"9.5.0")<0)
|
||||||
pre8_6 = true;
|
pre9_5 = true;
|
||||||
|
|
||||||
QSqlDatabase db = loadDatabaseFromFile(fullPath);
|
QSqlDatabase db = loadDatabaseFromFile(fullPath);
|
||||||
bool returnValue = false;
|
bool returnValue = false;
|
||||||
@ -790,7 +794,7 @@ bool DataBaseManagement::updateToCurrentVersion(const QString & fullPath)
|
|||||||
returnValue = returnValue && createV8Tables(db);
|
returnValue = returnValue && createV8Tables(db);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pre8_6)
|
if(pre9_5)
|
||||||
{
|
{
|
||||||
{//folder
|
{//folder
|
||||||
QStringList columnDefs;
|
QStringList columnDefs;
|
||||||
@ -805,6 +809,7 @@ bool DataBaseManagement::updateToCurrentVersion(const QString & fullPath)
|
|||||||
QStringList columnDefs;
|
QStringList columnDefs;
|
||||||
columnDefs << "lastTimeOpened INTEGER";
|
columnDefs << "lastTimeOpened INTEGER";
|
||||||
columnDefs << "coverSizeRatio REAL";
|
columnDefs << "coverSizeRatio REAL";
|
||||||
|
columnDefs << "originalCoverSize STRING";
|
||||||
returnValue = returnValue && addColumns("comic_info", columnDefs, db);
|
returnValue = returnValue && addColumns("comic_info", columnDefs, db);
|
||||||
|
|
||||||
QSqlQuery queryIndexLastTimeOpened(db);
|
QSqlQuery queryIndexLastTimeOpened(db);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user