diff --git a/src/tribler/core/database/orm_bindings/torrent_metadata.py b/src/tribler/core/database/orm_bindings/torrent_metadata.py index 735a1fad11..1c392b611c 100644 --- a/src/tribler/core/database/orm_bindings/torrent_metadata.py +++ b/src/tribler/core/database/orm_bindings/torrent_metadata.py @@ -107,7 +107,7 @@ def tdef_to_metadata_dict(tdef: TorrentDef) -> dict: "title": tdef.get_name_as_unicode()[:300], "tags": tags[:200], "size": tdef.get_length(), - "torrent_date": max(torrent_date, EPOCH), + "torrent_date": torrent_date if torrent_date >= EPOCH else EPOCH, "tracker_info": tracker_info, } diff --git a/src/tribler/core/libtorrent/download_manager/stream.py b/src/tribler/core/libtorrent/download_manager/stream.py index d97e892d4f..db38fedb96 100644 --- a/src/tribler/core/libtorrent/download_manager/stream.py +++ b/src/tribler/core/libtorrent/download_manager/stream.py @@ -492,7 +492,7 @@ async def open(self) -> None: while not filename.exists(): await sleep(1) - self.file = open(filename, "rb") # noqa: SIM115 + self.file = open(filename, "rb") # noqa: ASYNC101, SIM115 self.file.seek(self.seekpos) @property diff --git a/src/tribler/core/rendezvous/orm_bindings/certificate.py b/src/tribler/core/rendezvous/orm_bindings/certificate.py index 3d22f53ac0..68b330c557 100644 --- a/src/tribler/core/rendezvous/orm_bindings/certificate.py +++ b/src/tribler/core/rendezvous/orm_bindings/certificate.py @@ -27,7 +27,7 @@ class RendezvousCertificate(metaclass=IterRendezvousCertificate): start: float stop: float - def __init__(self, public_key: bytes, ip: bytes, port: int, ping: float, # noqa: D107 + def __init__(self, public_key: bytes, ip: bytes, port: int, ping: float, # noqa: D107, PLR0913 start: float, stop: float) -> None: ... @classmethod diff --git a/src/tribler/core/torrent_checker/torrentchecker_session.py b/src/tribler/core/torrent_checker/torrentchecker_session.py index 89417d00ac..6e24751127 100644 --- a/src/tribler/core/torrent_checker/torrentchecker_session.py +++ b/src/tribler/core/torrent_checker/torrentchecker_session.py @@ -283,7 +283,7 @@ class UdpTrackerSession(TrackerSession): # A list of transaction IDs that have been used in order to avoid conflict. _active_session_dict: dict[UdpTrackerSession, int] = {} - def __init__(self, tracker_url: str, tracker_address: tuple[str, int], announce_page: str, + def __init__(self, tracker_url: str, tracker_address: tuple[str, int], announce_page: str, # noqa: PLR0913 timeout: float, proxy: tuple, socket_mgr: UdpSocketManager) -> None: """ Create a session for UDP trackers.