mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-31 03:50:20 -07:00
Fix loading *.magnet files from watched folders. Closes #4701.
This commit is contained in:
parent
2f62a79135
commit
44624d0003
1 changed files with 1 additions and 5 deletions
|
@ -195,12 +195,8 @@ void FileSystemWatcher::addTorrentsFromDir(const QDir &dir, QStringList &torrent
|
||||||
foreach (const QString &file, files) {
|
foreach (const QString &file, files) {
|
||||||
const QString fileAbsPath = dir.absoluteFilePath(file);
|
const QString fileAbsPath = dir.absoluteFilePath(file);
|
||||||
if (fileAbsPath.endsWith(".magnet")) {
|
if (fileAbsPath.endsWith(".magnet")) {
|
||||||
QFile f(fileAbsPath);
|
|
||||||
if (f.open(QIODevice::ReadOnly)
|
|
||||||
&& !BitTorrent::MagnetUri(QString::fromLocal8Bit(f.readAll())).isValid()) {
|
|
||||||
torrents << fileAbsPath;
|
torrents << fileAbsPath;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (BitTorrent::TorrentInfo::loadFromFile(fileAbsPath).isValid()) {
|
else if (BitTorrent::TorrentInfo::loadFromFile(fileAbsPath).isValid()) {
|
||||||
torrents << fileAbsPath;
|
torrents << fileAbsPath;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue