mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 09:43:07 -07:00
FEATURE: If 2 torrents have the same hash, add new trackers to the existin
g torrent
This commit is contained in:
parent
2b37986007
commit
1065f5fb86
2 changed files with 27 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
||||||
- FEATURE: User can choose to apply transfer limits on LAN too
|
- FEATURE: User can choose to apply transfer limits on LAN too
|
||||||
- FEATURE: User can choose to include the protocol overhead in transfer limits
|
- FEATURE: User can choose to include the protocol overhead in transfer limits
|
||||||
- FEATURE: Torrents can be automatically rechecked on completion
|
- FEATURE: Torrents can be automatically rechecked on completion
|
||||||
|
- FEATURE: If 2 torrents have the same hash, add new trackers to the existing torrent
|
||||||
- COSMETIC: Improved style management
|
- COSMETIC: Improved style management
|
||||||
|
|
||||||
* Mon Jan 18 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.0
|
* Mon Jan 18 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.0
|
||||||
|
|
|
@ -978,6 +978,32 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
|
||||||
addConsoleMessage(tr("'%1' is already in download list.", "e.g: 'xxx.avi' is already in download list.").arg(file));
|
addConsoleMessage(tr("'%1' is already in download list.", "e.g: 'xxx.avi' is already in download list.").arg(file));
|
||||||
//emit duplicateTorrent(file);
|
//emit duplicateTorrent(file);
|
||||||
}
|
}
|
||||||
|
// Check if the torrent contains trackers we don't know about
|
||||||
|
// and add them
|
||||||
|
QTorrentHandle h_ex = getTorrentHandle(hash);
|
||||||
|
if(h_ex.is_valid()) {
|
||||||
|
std::vector<announce_entry> old_trackers = h.trackers();
|
||||||
|
std::vector<announce_entry> new_trackers = t->trackers();
|
||||||
|
bool trackers_added = false;
|
||||||
|
for(std::vector<announce_entry>::iterator it=new_trackers.begin();it!=new_trackers.end();it++) {
|
||||||
|
std::string tracker_url = it->url;
|
||||||
|
bool found = false;
|
||||||
|
for(std::vector<announce_entry>::iterator itold=old_trackers.begin();itold!=old_trackers.end();itold++) {
|
||||||
|
if(tracker_url == itold->url) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!found) {
|
||||||
|
trackers_added = true;
|
||||||
|
announce_entry entry(tracker_url);
|
||||||
|
h.add_tracker(entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(trackers_added) {
|
||||||
|
addConsoleMessage(tr("However, new trackers were added to the existing torrent."));
|
||||||
|
}
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
// Delete torrent from scan dir
|
// Delete torrent from scan dir
|
||||||
QFile::remove(file);
|
QFile::remove(file);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue