From 7c7559756c6b65416d45eb6498da94a4030e5b8a Mon Sep 17 00:00:00 2001 From: jacr13 Date: Mon, 12 Apr 2021 17:45:32 +0200 Subject: [PATCH] remove view image template on mobile requests --- app/utils/search.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/utils/search.py b/app/utils/search.py index 9328229..c099b4c 100644 --- a/app/utils/search.py +++ b/app/utils/search.py @@ -121,8 +121,11 @@ class Search: self.config, content_filter.near) - # force mobile search when view image is true - view_image = 'tbm=isch' in full_query and self.config.view_image + # force mobile search when view image is true and + # the request is not already made by a mobile + view_image = ('tbm=isch' in full_query + and self.config.view_image + and not g.user_request.mobile) get_body = g.user_request.send(query=full_query, force_mobile=view_image)