Skip to content

Commit

Permalink
Don't notify metainfo if there is no metainfo (#8338)
Browse files Browse the repository at this point in the history
  • Loading branch information
qstokkink authored Dec 13, 2024
2 parents c10d14f + b1733cb commit 1ed1139
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/tribler/core/libtorrent/download_manager/download_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,13 +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]
})
if not isinstance(download.tdef, TorrentDefNoMetainfo):
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))
Expand Down

0 comments on commit 1ed1139

Please sign in to comment.