mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Add a new boolean field for tagging comics as manga
This commit is contained in:
parent
8c6e8cdf36
commit
3ab05c6777
@ -181,7 +181,9 @@ bool DataBaseManagement::createTables(QSqlDatabase &database)
|
||||
//new 9.5 fields
|
||||
"lastTimeOpened INTEGER,"
|
||||
"coverSizeRatio REAL,"
|
||||
"originalCoverSize STRING" //h/w
|
||||
"originalCoverSize STRING," //h/w
|
||||
//new 9.8 fields
|
||||
"manga BOOLEAN DEFAULT 0"
|
||||
|
||||
")");
|
||||
success = success && queryComicInfo.exec();
|
||||
@ -402,6 +404,7 @@ bool DataBaseManagement::importComicsInfo(QString source, QString dest)
|
||||
"format = :format,"
|
||||
"color = :color,"
|
||||
"ageRating = :ageRating,"
|
||||
"manga = :manga"
|
||||
|
||||
"synopsis = :synopsis,"
|
||||
"characters = :characters,"
|
||||
@ -478,6 +481,7 @@ bool DataBaseManagement::importComicsInfo(QString source, QString dest)
|
||||
":format,"
|
||||
":color,"
|
||||
":ageRating,"
|
||||
":manga,"
|
||||
|
||||
":synopsis,"
|
||||
":characters,"
|
||||
@ -580,6 +584,7 @@ void DataBaseManagement::bindValuesFromRecord(const QSqlRecord &record, QSqlQuer
|
||||
bindString("format", record, query);
|
||||
bindInt("color", record, query);
|
||||
bindString("ageRating", record, query);
|
||||
bindInt("manga", record, query);
|
||||
|
||||
bindString("synopsis", record, query);
|
||||
bindString("characters", record, query);
|
||||
@ -707,6 +712,7 @@ bool DataBaseManagement::updateToCurrentVersion(const QString &path)
|
||||
bool pre7_1 = false;
|
||||
bool pre8 = false;
|
||||
bool pre9_5 = false;
|
||||
bool pre9_8 = false;
|
||||
|
||||
QString fullPath = path + "/library.ydb";
|
||||
|
||||
@ -718,6 +724,8 @@ bool DataBaseManagement::updateToCurrentVersion(const QString &path)
|
||||
pre8 = true;
|
||||
if (compareVersions(DataBaseManagement::checkValidDB(fullPath), "9.5.0") < 0)
|
||||
pre9_5 = true;
|
||||
if (compareVersions(DataBaseManagement::checkValidDB(fullPath), "9.8.0") < 0)
|
||||
pre9_8 = true;
|
||||
|
||||
QString connectionName = "";
|
||||
bool returnValue = false;
|
||||
@ -828,6 +836,15 @@ bool DataBaseManagement::updateToCurrentVersion(const QString &path)
|
||||
db.commit();
|
||||
}
|
||||
}
|
||||
|
||||
if (pre9_8) {
|
||||
{ //comic_info
|
||||
QStringList columnDefs;
|
||||
columnDefs << "manga BOOLEAN DEFAULT 0";
|
||||
bool successAddingColumns = addColumns("comic_info", columnDefs, db);
|
||||
returnValue = returnValue && successAddingColumns;
|
||||
}
|
||||
}
|
||||
}
|
||||
connectionName = db.connectionName();
|
||||
}
|
||||
|
@ -564,7 +564,11 @@ void DBHelper::update(ComicInfo *comicInfo, QSqlDatabase &db)
|
||||
"lastTimeOpened = :lastTimeOpened,"
|
||||
|
||||
"coverSizeRatio = :coverSizeRatio,"
|
||||
"originalCoverSize = :originalCoverSize"
|
||||
"originalCoverSize = :originalCoverSize,"
|
||||
//--
|
||||
|
||||
//new 9.8 fields
|
||||
"manga = :manga"
|
||||
//--
|
||||
" WHERE id = :id ");
|
||||
|
||||
@ -596,6 +600,7 @@ void DBHelper::update(ComicInfo *comicInfo, QSqlDatabase &db)
|
||||
updateComicInfo.bindValue(":format", comicInfo->format);
|
||||
updateComicInfo.bindValue(":color", comicInfo->color);
|
||||
updateComicInfo.bindValue(":ageRating", comicInfo->ageRating);
|
||||
updateComicInfo.bindValue(":manga", comicInfo->manga);
|
||||
|
||||
updateComicInfo.bindValue(":synopsis", comicInfo->synopsis);
|
||||
updateComicInfo.bindValue(":characters", comicInfo->characters);
|
||||
@ -1330,6 +1335,7 @@ QList<ComicDB> DBHelper::getSortedComicsFromParent(qulonglong parentId, QSqlData
|
||||
int format = record.indexOf("format");
|
||||
int color = record.indexOf("color");
|
||||
int ageRating = record.indexOf("ageRating");
|
||||
int manga = record.indexOf("manga");
|
||||
|
||||
int synopsis = record.indexOf("synopsis");
|
||||
int characters = record.indexOf("characters");
|
||||
@ -1394,6 +1400,7 @@ QList<ComicDB> DBHelper::getSortedComicsFromParent(qulonglong parentId, QSqlData
|
||||
currentItem.info.format = selectQuery.value(format);
|
||||
currentItem.info.color = selectQuery.value(color);
|
||||
currentItem.info.ageRating = selectQuery.value(ageRating);
|
||||
currentItem.info.manga = selectQuery.value(manga);
|
||||
|
||||
currentItem.info.synopsis = selectQuery.value(synopsis);
|
||||
currentItem.info.characters = selectQuery.value(characters);
|
||||
@ -1696,6 +1703,7 @@ ComicInfo DBHelper::loadComicInfo(QString hash, QSqlDatabase &db)
|
||||
int format = record.indexOf("format");
|
||||
int color = record.indexOf("color");
|
||||
int ageRating = record.indexOf("ageRating");
|
||||
int manga = record.indexOf("manga");
|
||||
|
||||
int synopsis = record.indexOf("synopsis");
|
||||
int characters = record.indexOf("characters");
|
||||
@ -1767,6 +1775,10 @@ ComicInfo DBHelper::loadComicInfo(QString hash, QSqlDatabase &db)
|
||||
comicInfo.originalCoverSize = findComicInfo.value(originalCoverSize);
|
||||
//--
|
||||
|
||||
//new 9.8 fields
|
||||
comicInfo.manga = findComicInfo.value(manga);
|
||||
//--
|
||||
|
||||
comicInfo.existOnDb = true;
|
||||
} else
|
||||
comicInfo.existOnDb = false;
|
||||
|
@ -102,6 +102,9 @@ QString ComicDB::toTXT()
|
||||
|
||||
if (!info.ageRating.isNull())
|
||||
txt.append(QString("ageRating:%1\r\n").arg(info.ageRating.toString()));
|
||||
|
||||
if (!info.manga.isNull())
|
||||
txt.append(QString("manga:%1\r\n").arg(info.manga.toString()));
|
||||
//Argumento
|
||||
if (!info.synopsis.isNull())
|
||||
txt.append(QString("synopsis:%1\r\n").arg(info.synopsis.toString()));
|
||||
@ -232,6 +235,7 @@ ComicInfo &ComicInfo::operator=(const ComicInfo &comicInfo)
|
||||
publisher = comicInfo.publisher;
|
||||
format = comicInfo.format;
|
||||
color = comicInfo.color;
|
||||
manga = comicInfo.manga;
|
||||
ageRating = comicInfo.ageRating;
|
||||
synopsis = comicInfo.synopsis;
|
||||
characters = comicInfo.characters;
|
||||
@ -537,6 +541,7 @@ QDataStream &operator<<(QDataStream &stream, const ComicInfo &comicInfo)
|
||||
stream << comicInfo.format;
|
||||
stream << comicInfo.color;
|
||||
stream << comicInfo.ageRating;
|
||||
stream << comicInfo.manga;
|
||||
|
||||
stream << comicInfo.synopsis;
|
||||
stream << comicInfo.characters;
|
||||
@ -598,6 +603,7 @@ QDataStream &operator>>(QDataStream &stream, ComicInfo &comicInfo)
|
||||
stream >> comicInfo.format;
|
||||
stream >> comicInfo.color;
|
||||
stream >> comicInfo.ageRating;
|
||||
stream >> comicInfo.manga;
|
||||
|
||||
stream >> comicInfo.synopsis;
|
||||
stream >> comicInfo.characters;
|
||||
|
@ -73,6 +73,7 @@ public:
|
||||
QVariant format; //string
|
||||
QVariant color; //bool
|
||||
QVariant ageRating; //string
|
||||
QVariant manga; //bool
|
||||
|
||||
QVariant synopsis; //string
|
||||
QVariant characters; //string
|
||||
@ -180,6 +181,7 @@ public:
|
||||
Q_PROPERTY(QVariant format MEMBER format CONSTANT)
|
||||
Q_PROPERTY(QVariant color MEMBER color CONSTANT)
|
||||
Q_PROPERTY(QVariant ageRating MEMBER ageRating CONSTANT)
|
||||
Q_PROPERTY(QVariant manga MEMBER manga CONSTANT)
|
||||
|
||||
Q_PROPERTY(QVariant synopsis MEMBER synopsis CONSTANT)
|
||||
Q_PROPERTY(QVariant characters MEMBER characters CONSTANT)
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <QStandardPaths>
|
||||
|
||||
#define VERSION "9.7.1"
|
||||
#define VERSION "9.8.0"
|
||||
|
||||
#define REMOTE_BROWSE_PERFORMANCE_WORKAROUND "REMOTE_BROWSE_PERFORMANCE_WORKAROUND"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user