From b38036d519c8b74d7be972e7b730b50f92fa8db4 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Tue, 4 Jan 2022 15:39:19 +0100 Subject: [PATCH] [fix] stop setting superfluous cookies for "non tab categories" --- searx/preferences.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/searx/preferences.py b/searx/preferences.py index 2a9b0af0c..918a7a300 100644 --- a/searx/preferences.py +++ b/searx/preferences.py @@ -12,6 +12,7 @@ from urllib.parse import parse_qs, urlencode from searx import settings, autocomplete from searx.locales import LOCALE_NAMES from searx.webutils import VALID_LANGUAGE_CODE +from searx.engines import OTHER_CATEGORY COOKIE_MAX_AGE = 60 * 60 * 24 * 365 * 5 # 5 years @@ -271,6 +272,8 @@ class EnginesSetting(SwitchableSetting): transformed_choices = [] for engine_name, engine in self.choices.items(): # pylint: disable=no-member,access-member-before-definition for category in engine.categories: + if not category in settings['categories_as_tabs'] + [OTHER_CATEGORY]: + continue transformed_choice = {} transformed_choice['default_on'] = not engine.disabled transformed_choice['id'] = '{}__{}'.format(engine_name, category)