From f89c0d40417964091075108d508fd026c9c55f9c Mon Sep 17 00:00:00 2001 From: Vaibhav Srivastava Date: Sat, 15 Aug 2026 00:55:40 +0530 Subject: [PATCH 1/2] fix(download): read has_metadata from torrent status torrent_handle.has_metadata() is deprecated upstream and is compiled out of builds configured without deprecated functions, which is how Arch ships libtorrent-rasterbar 2.1. On those builds check_metadata_updates() raises AttributeError: 'torrent_handle' object has no attribute 'has_metadata'. torrent_status.has_metadata carries the same information and is present on every version the project supports (libtorrent>=2.0.11), so read it from handle.status() instead. Fixes #285 --- src/torrra/core/download.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/torrra/core/download.py b/src/torrra/core/download.py index 315a06e..33c4d28 100644 --- a/src/torrra/core/download.py +++ b/src/torrra/core/download.py @@ -131,10 +131,14 @@ def check_metadata_updates(self) -> None: for magnet_uri, handle in self.torrents.items(): # Only check for metadata if we haven't updated it yet + # `torrent_handle.has_metadata()` is deprecated upstream and is + # absent from builds compiled without deprecated functions (Arch's + # libtorrent-rasterbar 2.1 among them). The status field is + # available on every supported version. if ( magnet_uri not in self._metadata_updated and handle.is_valid() - and handle.has_metadata() + and handle.status().has_metadata ): # Get the torrent info try: From 033e44bffb64ff0302a44893cf773149ea9c0625 Mon Sep 17 00:00:00 2001 From: stabldev <114811070+stabldev@users.noreply.github.com> Date: Sat, 15 Aug 2026 21:04:06 +0530 Subject: [PATCH 2/2] chore: remove unnecessary comments --- src/torrra/core/download.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/torrra/core/download.py b/src/torrra/core/download.py index 9bd905f..53196cc 100644 --- a/src/torrra/core/download.py +++ b/src/torrra/core/download.py @@ -131,10 +131,6 @@ def check_metadata_updates(self) -> None: for magnet_uri, handle in self.torrents.items(): # Only check for metadata if we haven't updated it yet - # `torrent_handle.has_metadata()` is deprecated upstream and is - # absent from builds compiled without deprecated functions (Arch's - # libtorrent-rasterbar 2.1 among them). The status field is - # available on every supported version. if ( magnet_uri not in self._metadata_updated and handle.is_valid()