From ddf44ac2b57143615cbdec1cfbf3223735276387 Mon Sep 17 00:00:00 2001 From: King-of-the-all-Cookies Date: Fri, 1 May 2026 17:15:19 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BF=D1=80=D0=BE=D1=89=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=B8=20=D0=BD=D0=BE=D1=80=D0=BC=D0=B0=D0=BB=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D0=B8=20=D0=BF=D0=BE=D0=BB=D0=B5=D0=B9=20?= =?UTF-8?q?=D0=B2=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE=D1=81=D0=B0=D1=85=20?= =?UTF-8?q?=D0=BA=20VNDB=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 6 +++--- vndb_client.py | 15 ++------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/bot.py b/bot.py index 6fd5ac5..5b4826d 100644 --- a/bot.py +++ b/bot.py @@ -182,7 +182,7 @@ Staff: {stats.get('staff', 0)} ) results = await vndb_client.query_vn( - filters=["search", "=", query.strip().lower()], + filters=["search", "=", query.strip()], fields=["id", "title", "image.url"], results=10 ) @@ -226,7 +226,7 @@ Staff: {stats.get('staff', 0)} return ConversationHandler.END results = await vndb_client.query_character( - filters=["search", "=", query.strip().lower()], + filters=["search", "=", query.strip()], fields=["id", "name", "original", "image.url"], results=10 ) @@ -253,7 +253,7 @@ Staff: {stats.get('staff', 0)} query = " ".join(context.args) results = await vndb_client.query_release( - filters=["search", "=", query.strip().lower()], # ✔️ важно + filters=["search", "=", query.strip()], # ✔️ важно fields=["id", "title"], results=10 ) diff --git a/vndb_client.py b/vndb_client.py index f04bd8b..d0e9dbf 100644 --- a/vndb_client.py +++ b/vndb_client.py @@ -49,25 +49,14 @@ class VndbClient: if token: self.headers["Authorization"] = f"Token {token}" - def _safe_filters(self, filters: Optional[List[Any]]) -> List[Any]: - if not filters: - return [] + def _safe_filters(self, filters): return filters def _normalize_fields(self, fields: Optional[List[str]]) -> str: if not fields: return "id" - fixed = [] - for f in fields: - # FIX OLD STYLE image{url} - if "image{" in f: - f = f.replace("image{url}", "image.url") - f = f.replace("image{id,url}", "image.id,image.url") - - fixed.append(f) - - return ",".join(fixed) + return ",".join(fields) async def _request( self,