diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/torrent_metadata.py b/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/torrent_metadata.py index 725ed5b4943..6b58f684144 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/torrent_metadata.py +++ b/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/torrent_metadata.py @@ -93,9 +93,6 @@ def add_tracker(self, tracker_url): tracker = db.TrackerState.get_for_update(url=sanitized_url) or db.TrackerState(url=sanitized_url) self.health.trackers.add(tracker) - def before_update(self): - self.add_tracker(self.tracker_info) - def get_magnet(self): return (f"magnet:?xt=urn:btih:{hexlify(self.infohash)}&dn={self.title}") + ( f"&tr={self.tracker_info}" if self.tracker_info else "" diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/serialization.py b/src/tribler-core/tribler_core/components/metadata_store/db/serialization.py index 1f2316afb97..695f868c966 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/serialization.py +++ b/src/tribler-core/tribler_core/components/metadata_store/db/serialization.py @@ -74,10 +74,6 @@ def read_payload_with_offset(data, offset=0): raise UnknownBlobTypeException -def read_payload(data): - return read_payload_with_offset(data)[0] - - class SignedPayload(Payload): """ Payload for metadata. diff --git a/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/remote_query_community.py b/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/remote_query_community.py index d3d3b6899bd..da2e7a31b77 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/remote_query_community.py +++ b/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/remote_query_community.py @@ -20,7 +20,6 @@ from tribler_core.utilities.unicode import hexlify BINARY_FIELDS = ("infohash", "channel_pk") -NO_RESPONSE = unhexlify("7ca1e9e922895a477a52cc9d6031020355eb172735bf83c058cb03ddcc9c6408") def sanitize_query(query_dict, cap=100): diff --git a/src/tribler-core/tribler_core/components/metadata_store/restapi/search_endpoint.py b/src/tribler-core/tribler_core/components/metadata_store/restapi/search_endpoint.py index b5b7aa6dd4d..581d7b1fc18 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/restapi/search_endpoint.py +++ b/src/tribler-core/tribler_core/components/metadata_store/restapi/search_endpoint.py @@ -24,10 +24,6 @@ class SearchEndpoint(MetadataEndpointBase): def setup_routes(self): self.app.add_routes([web.get('', self.search), web.get('/completions', self.completions)]) - @staticmethod - def get_uuid(parameters): - return parameters['uuid'] if 'uuid' in parameters else None - @classmethod def sanitize_parameters(cls, parameters): sanitized = super().sanitize_parameters(parameters) diff --git a/src/tribler-core/tribler_core/components/restapi/rest/__init__.py b/src/tribler-core/tribler_core/components/restapi/rest/__init__.py index 1767a9c3236..2aa7337ec7b 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/__init__.py +++ b/src/tribler-core/tribler_core/components/restapi/rest/__init__.py @@ -2,10 +2,6 @@ This package contains code for the Tribler HTTP API. """ -VOTE_UNSUBSCRIBE = 0 -VOTE_SUBSCRIBE = 2 - - def has_param(parameters, name): return name in parameters and len(parameters[name]) > 0 diff --git a/src/tribler-core/tribler_core/components/restapi/rest/rest_endpoint.py b/src/tribler-core/tribler_core/components/restapi/rest/rest_endpoint.py index 830cdc42c47..c471bfbc1e3 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/rest_endpoint.py +++ b/src/tribler-core/tribler_core/components/restapi/rest/rest_endpoint.py @@ -6,7 +6,6 @@ HTTP_BAD_REQUEST = 400 HTTP_UNAUTHORIZED = 401 HTTP_NOT_FOUND = 404 -HTTP_CONFLICT = 409 HTTP_INTERNAL_SERVER_ERROR = 500 diff --git a/src/tribler-core/tribler_core/components/restapi/rest/root_endpoint.py b/src/tribler-core/tribler_core/components/restapi/rest/root_endpoint.py index fa5d2673129..376ce8b2418 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/root_endpoint.py +++ b/src/tribler-core/tribler_core/components/restapi/rest/root_endpoint.py @@ -65,7 +65,3 @@ def setup_routes(self): for path, (ep_cls, enabled) in endpoints.items(): if enabled: self.add_endpoint(path, ep_cls()) - - def set_ipv8_session(self, ipv8_session): - if '/ipv8' in self.endpoints: - self.endpoints['/ipv8'].initialize(ipv8_session) diff --git a/src/tribler-core/tribler_core/components/restapi/rest/schema.py b/src/tribler-core/tribler_core/components/restapi/rest/schema.py index 932e9efee1b..6e2d8079abc 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/schema.py +++ b/src/tribler-core/tribler_core/components/restapi/rest/schema.py @@ -6,7 +6,3 @@ class HandledErrorSchema(Schema): error = String(description='Optional field describing any failures that may have occurred', required=True) - - -class UnhandledErrorSchema(Schema): - error = schema(DetailedErrorSchema={'handled': Boolean, 'code': Integer, 'message': String}) diff --git a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_rest_manager.py b/src/tribler-core/tribler_core/components/restapi/rest/tests/test_rest_manager.py index a4a35c62039..cca7247aaf0 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_rest_manager.py +++ b/src/tribler-core/tribler_core/components/restapi/rest/tests/test_rest_manager.py @@ -4,7 +4,6 @@ import pytest from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.exceptions import TriblerException from tribler_core.components.restapi.rest.base_api_test import do_real_request from tribler_core.components.restapi.rest.rest_endpoint import HTTP_UNAUTHORIZED from tribler_core.components.restapi.rest.rest_manager import ApiKeyMiddleware, RESTManager, error_middleware @@ -12,10 +11,6 @@ from tribler_core.tests.tools.common import TESTS_DIR -def RaiseException(*args, **kwargs): - raise TriblerException("Oops! Something went wrong. Please restart Tribler") - - @pytest.fixture() def tribler_config(): return TriblerConfig()