mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 08:48:07 -06:00
- BUGFIX: Added safety mecanism which adds the torrents back to the list in case qbittorrent-resume.conf gets deleted or corrupted.
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v1.5.5
|
* Wed Nov 4 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.5
|
||||||
- BUGFIX: Fixed man page
|
- BUGFIX: Fixed man page
|
||||||
- BUGFIX: Fix crash on torrent addition (if libtorrent-rasterbar has debug enabled)
|
- BUGFIX: Fix crash on torrent addition (if libtorrent-rasterbar has debug enabled)
|
||||||
- BUGFIX: Fix trackers addition to torrents (bug introduced in v1.5.4)
|
- BUGFIX: Fix trackers addition to torrents (bug introduced in v1.5.4)
|
||||||
- BUGFIX: Suppress compilation warning regarding sortNewsList() not being used
|
- BUGFIX: Suppress compilation warning regarding sortNewsList() not being used
|
||||||
- BUGFIX: Make sure scan folder is different than qBittorrent backup directory to avoid torrents deletion
|
- BUGFIX: Make sure scan folder is different than qBittorrent backup directory to avoid torrents deletion
|
||||||
|
- BUGFIX: Added safety mecanism which adds the torrents back to the list in case qbittorrent-resume.conf gets deleted or corrupted.
|
||||||
|
|
||||||
* Sun Oct 25 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.4
|
* Sun Oct 25 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.4
|
||||||
- BUGFIX: Updated man page
|
- BUGFIX: Updated man page
|
||||||
|
|||||||
@@ -1527,14 +1527,31 @@ void bittorrent::applyEncryptionSettings(pe_settings se) {
|
|||||||
// backup directory
|
// backup directory
|
||||||
void bittorrent::startUpTorrents() {
|
void bittorrent::startUpTorrents() {
|
||||||
qDebug("Resuming unfinished torrents");
|
qDebug("Resuming unfinished torrents");
|
||||||
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
QDir torrentBackup(misc::qBittorrentPath() + "BT_backup");
|
QDir torrentBackup(misc::qBittorrentPath() + "BT_backup");
|
||||||
QStringList fileNames;
|
QStringList fileNames;
|
||||||
QStringList known_torrents = TorrentPersistentData::knownTorrents();
|
QStringList known_torrents = TorrentPersistentData::knownTorrents();
|
||||||
if(known_torrents.empty()) {
|
|
||||||
|
if(known_torrents.empty() && !settings.value("v1_4_x_torrent_imported", false).toBool()) {
|
||||||
qDebug("No known torrent, importing old torrents");
|
qDebug("No known torrent, importing old torrents");
|
||||||
importOldTorrents();
|
importOldTorrents();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Safety measure because some people reported torrent loss since
|
||||||
|
// we switch the v1.5 way of resuming torrents on startup
|
||||||
|
QStringList filters;
|
||||||
|
filters << "*.torrent";
|
||||||
|
QStringList torrents_on_hd = torrentBackup.entryList(filters, QDir::Files, QDir::Unsorted);
|
||||||
|
foreach(QString hash, torrents_on_hd) {
|
||||||
|
hash.chop(8); // remove trailing .torrent
|
||||||
|
if(!known_torrents.contains(hash)) {
|
||||||
|
std::cerr << "ERROR Detected!!! Adding back torrent " << hash.toLocal8Bit().data() << " which got lost for some reason." << std::endl;
|
||||||
|
addTorrent(torrentBackup.path()+QDir::separator()+hash+".torrent", false, QString(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// End of safety measure
|
||||||
|
|
||||||
qDebug("Starting up torrents");
|
qDebug("Starting up torrents");
|
||||||
if(isQueueingEnabled()) {
|
if(isQueueingEnabled()) {
|
||||||
QList<QPair<int, QString> > hashes;
|
QList<QPair<int, QString> > hashes;
|
||||||
@@ -1695,7 +1712,7 @@ void bittorrent::applyFormerAttributeFiles(QTorrentHandle h) {
|
|||||||
// TODO: Remove in qBittorrent v1.6.0
|
// TODO: Remove in qBittorrent v1.6.0
|
||||||
void bittorrent::importOldTorrents() {
|
void bittorrent::importOldTorrents() {
|
||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
if(!settings.value("v1_4_x_torrent_imported", false).toBool()) {
|
Q_ASSERT(!settings.value("v1_4_x_torrent_imported", false).toBool());
|
||||||
// Import old torrent
|
// Import old torrent
|
||||||
QDir torrentBackup(misc::qBittorrentPath() + "BT_backup");
|
QDir torrentBackup(misc::qBittorrentPath() + "BT_backup");
|
||||||
QStringList fileNames;
|
QStringList fileNames;
|
||||||
@@ -1770,4 +1787,3 @@ void bittorrent::importOldTorrents() {
|
|||||||
settings.setValue("v1_4_x_torrent_imported", true);
|
settings.setValue("v1_4_x_torrent_imported", true);
|
||||||
std::cout << "Successfully imported torrents from v1.4.x (or previous) instance" << std::endl;
|
std::cout << "Successfully imported torrents from v1.4.x (or previous) instance" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user