From 8f00e7978d2b9a24af7c4c89f2b3cbf7116911d3 Mon Sep 17 00:00:00 2001 From: Marcel Gregoriadis Date: Tue, 15 Oct 2024 15:00:54 +0200 Subject: [PATCH] fix lin --- src/tribler/core/recommender/community.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tribler/core/recommender/community.py b/src/tribler/core/recommender/community.py index c44635bd1a..4a67a8a724 100644 --- a/src/tribler/core/recommender/community.py +++ b/src/tribler/core/recommender/community.py @@ -177,7 +177,7 @@ def process_query_info(self, peer: Peer, request: dict) -> None: query_id=query.rowid, results=len(unpacked["results"]), chosen_index=unpacked["chosen_index"], - timestamp=unpacked["timestamp"] if "timestamp" in unpacked else 0, + timestamp=unpacked.get("timestamp", 0), query=unpacked["query"], )), b"")) @@ -222,7 +222,7 @@ def __init__(self, request_cache: RequestCache, peer: Peer, response: dict) -> N self.total_results = response["results"] self.results: list[ResultItem | None] = [None] * self.total_results self.chosen_index = response["chosen_index"] - self.timestamp = response["timestamp"] if "timestamp" in response else 0 + self.timestamp = response.get("timestamp", 0) self.query = response["query"] def get_next_range(self) -> tuple[int, int] | None: