From 35eee0b590e8a5a0c382f8a49c81afd39911b656 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sun, 13 May 2018 11:47:38 +0300 Subject: [PATCH] Don't migrate torrents that have newer fastresumes --- src/app/upgrade.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/upgrade.h b/src/app/upgrade.h index 18791b50b..e9e0ae211 100644 --- a/src/app/upgrade.h +++ b/src/app/upgrade.h @@ -145,6 +145,15 @@ bool upgradeResumeFile(const QString &filepath, const QVariantHash &oldTorrent = // in versions < 3.3 we have -1 for seeding torrents, so we convert it to 0 fastNew["qBt-queuePosition"] = (queuePosition >= 0 ? queuePosition : 0); + if (v3_3) { + QFileInfo oldFile(filepath); + QFileInfo newFile(outFilePath); + if (newFile.exists() + && (oldFile.lastModified() < newFile.lastModified())) { + Utils::Fs::forceRemove(filepath); + return true; + } + } QFile file2(outFilePath); QVector out; libtorrent::bencode(std::back_inserter(out), fastNew);