mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-21 16:07:23 -06:00
Improve loading of magnet metadata in the background.
Conflicts: src/qtlibtorrent/qbtsession.cpp
This commit is contained in:
@@ -114,6 +114,38 @@ private:
|
||||
static QHash<QString, TorrentData> data;
|
||||
};
|
||||
|
||||
class HiddenData {
|
||||
public:
|
||||
static void addData(const QString &hash) {
|
||||
hashes.append(hash);
|
||||
}
|
||||
|
||||
static bool hasData(const QString &hash) {
|
||||
return hashes.contains(hash, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
static void deleteData(const QString &hash) {
|
||||
if (hashes.removeAll(hash))
|
||||
metadata_counter--;
|
||||
}
|
||||
|
||||
static int getSize() {
|
||||
return hashes.size();
|
||||
}
|
||||
|
||||
static int getDownloadingSize() {
|
||||
return hashes.size() - metadata_counter;
|
||||
}
|
||||
|
||||
static void gotMetadata() {
|
||||
metadata_counter++;
|
||||
}
|
||||
|
||||
private:
|
||||
static QStringList hashes;
|
||||
static unsigned int metadata_counter;
|
||||
};
|
||||
|
||||
class TorrentPersistentData {
|
||||
public:
|
||||
enum RatioLimit {
|
||||
|
||||
Reference in New Issue
Block a user