Browse Source

Don't forget to create 'download_path' field

PR #16468.
adaptive-webui-19844
Vladimir Golovnev 3 years ago committed by GitHub
parent
commit
0657238ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/base/bittorrent/dbresumedatastorage.cpp

4
src/base/bittorrent/dbresumedatastorage.cpp

@ -43,6 +43,7 @@ @@ -43,6 +43,7 @@
#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlQuery>
#include <QSqlRecord>
#include <QThread>
#include <QVector>
@ -207,7 +208,7 @@ BitTorrent::DBResumeDataStorage::DBResumeDataStorage(const Path &dbPath, QObject @@ -207,7 +208,7 @@ BitTorrent::DBResumeDataStorage::DBResumeDataStorage(const Path &dbPath, QObject
else
{
const int dbVersion = currentDBVersion();
if (dbVersion == 1)
if ((dbVersion == 1) || !db.record(DB_TABLE_TORRENTS).contains(DB_COLUMN_DOWNLOAD_PATH.name))
updateDBFromVersion1();
}
@ -423,6 +424,7 @@ void BitTorrent::DBResumeDataStorage::createDB() const @@ -423,6 +424,7 @@ void BitTorrent::DBResumeDataStorage::createDB() const
makeColumnDefinition(DB_COLUMN_CATEGORY, "TEXT"),
makeColumnDefinition(DB_COLUMN_TAGS, "TEXT"),
makeColumnDefinition(DB_COLUMN_TARGET_SAVE_PATH, "TEXT"),
makeColumnDefinition(DB_COLUMN_DOWNLOAD_PATH, "TEXT"),
makeColumnDefinition(DB_COLUMN_CONTENT_LAYOUT, "TEXT NOT NULL"),
makeColumnDefinition(DB_COLUMN_RATIO_LIMIT, "INTEGER NOT NULL"),
makeColumnDefinition(DB_COLUMN_SEEDING_TIME_LIMIT, "INTEGER NOT NULL"),

Loading…
Cancel
Save