mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 09:43:07 -07:00
- Make sure torrents are complete before auto downloader picks them up
This commit is contained in:
parent
00a17b9447
commit
a2792efa72
1 changed files with 5 additions and 4 deletions
|
@ -987,11 +987,12 @@ void bittorrent::scanDirectory(QString scan_dir) {
|
||||||
foreach(const QString &file, files) {
|
foreach(const QString &file, files) {
|
||||||
QString fullPath = dir.path()+QDir::separator()+file;
|
QString fullPath = dir.path()+QDir::separator()+file;
|
||||||
QFile torrent(fullPath);
|
QFile torrent(fullPath);
|
||||||
if(torrent.size() != 0) {
|
qDebug("Adding for scan_dir: %s", fullPath.toLocal8Bit().data());
|
||||||
qDebug("Adding for scan_dir: %s", fullPath.toLocal8Bit().data());
|
try {
|
||||||
|
torrent_info t(fullPath.toLocal8Bit().data());
|
||||||
addTorrent(fullPath, true);
|
addTorrent(fullPath, true);
|
||||||
} else {
|
} catch(std::exception&) {
|
||||||
qDebug("Ignoring empty file: %s", fullPath.toLocal8Bit().data());
|
qDebug("Ignoring incomplete torrent file: %s", fullPath.toLocal8Bit().data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FSMutex->unlock();
|
FSMutex->unlock();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue