Skip to content

Commit

Permalink
Notify updated metadata after starting handle
Browse files Browse the repository at this point in the history
  • Loading branch information
qstokkink committed Dec 2, 2024
1 parent b3bd53d commit dee06a2
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,14 @@ async def start_handle(self, download: Download, atp: dict) -> None:
_ = self.replace_task(f"AddTorrent{infohash}", self._async_add_torrent, ltsession, infohash, atp,
ignore=(Exception,))

self.notifier.notify(Notification.torrent_metadata_added, metadata={
"infohash": infohash,
"size": download.tdef.get_length(),
"title": download.tdef.get_name_utf8(),
"metadata_type": 300,
"tracker_info": (list(download.tdef.get_trackers()) or [""])[0]
})

async def _async_add_torrent(self, ltsession: lt.session, infohash: bytes , atp: dict) -> None:
self._logger.debug("Adding handle %s", hexlify(infohash))
# To prevent flooding the DHT with a short burst of queries and triggering
Expand Down

0 comments on commit dee06a2

Please sign in to comment.