fix: announcer not updated after torrent announce list edited (#4635)

This commit is contained in:
Charles Kerr
2023-01-22 11:53:08 -06:00
committed by GitHub
parent 980cc6f922
commit 0f4077a445
4 changed files with 15 additions and 3 deletions

View File

@@ -1102,6 +1102,7 @@ char const* addTrackerUrls(tr_torrent* tor, tr_variant* urls)
}
tor->announceList().save(tor->torrentFile());
tor->on_announce_list_changed();
return nullptr;
}
@@ -1128,6 +1129,7 @@ char const* replaceTrackers(tr_torrent* tor, tr_variant* urls)
}
tor->announceList().save(tor->torrentFile());
tor->on_announce_list_changed();
return nullptr;
}
@@ -1154,6 +1156,7 @@ char const* removeTrackers(tr_torrent* tor, tr_variant* ids)
}
tor->announceList().save(tor->torrentFile());
tor->on_announce_list_changed();
return nullptr;
}

View File

@@ -845,7 +845,10 @@ public:
void fetch(tr_web::FetchOptions&& options) const
{
web_->fetch(std::move(options));
if (web_)
{
web_->fetch(std::move(options));
}
}
[[nodiscard]] constexpr auto const& bandwidthGroups() const noexcept

View File

@@ -2189,8 +2189,7 @@ bool tr_torrent::setTrackerList(std::string_view text)
}
}
/* tell the announcer to reload this torrent's tracker list */
this->session->announcer_->resetTorrent(this);
on_announce_list_changed();
return true;
}

View File

@@ -788,6 +788,13 @@ public:
return announce_key_;
}
// should be called when done modifying the torrent's announce list.
void on_announce_list_changed()
{
markEdited();
session->announcer_->resetTorrent(this);
}
tr_torrent_metainfo metainfo_;
tr_bandwidth bandwidth_;