diff --git a/Changelog b/Changelog index b94377a6d..69cdb66b8 100644 --- a/Changelog +++ b/Changelog @@ -8,7 +8,7 @@ - FEATURE: User can choose to apply transfer limits on LAN too - FEATURE: User can choose to include the protocol overhead in transfer limits - FEATURE: Torrents can be automatically rechecked on completion - - FEATURE: If 2 torrents have the same hash, add new trackers to the existing torrent + - FEATURE: If 2 torrents have the same hash, add new trackers/URL seeds to the existing torrent - FEATURE: Trackers can be added from Web UI - COSMETIC: Improved style management diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index f8f0de6c1..fa095054c 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -978,7 +978,7 @@ 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)); //emit duplicateTorrent(file); } - // Check if the torrent contains trackers we don't know about + // Check if the torrent contains trackers or url seeds we don't know about // and add them QTorrentHandle h_ex = getTorrentHandle(hash); if(h_ex.is_valid()) { @@ -1001,7 +1001,20 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr } } if(trackers_added) { - addConsoleMessage(tr("However, new trackers were added to the existing torrent.")); + addConsoleMessage(tr("Note: new trackers were added to the existing torrent.")); + } + bool urlseeds_added = false; + QStringList old_urlseeds = h_ex.url_seeds(); + std::vector new_urlseeds = t->url_seeds(); + for(std::vector::iterator it = new_urlseeds.begin(); it != new_urlseeds.end(); it++) { + QString new_url = misc::toQString(it->c_str()); + if(!old_urlseeds.contains(new_url)) { + urlseeds_added = true; + h_ex.add_url_seed(new_url); + } + } + if(urlseeds_added) { + addConsoleMessage(tr("Note: new URL seeds were added to the existing torrent.")); } } }else{