From aaccefb5a5c42c1f8473450b163c6c83509bd857 Mon Sep 17 00:00:00 2001 From: projectmoon Date: Fri, 22 Nov 2024 13:11:05 +0100 Subject: [PATCH] OSM: fix misleading resolve message (again). --- CHANGELOG.md | 4 ++++ osm.py | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fb7124..64d534b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # OpenStreetMap Tool +**1.1.2:** + - Fix misleading Nominatim resolution complete event that was + communicating as still resolving. + **1.1.1:** - Send resolution complete event when pulling Nominatim info from cache. diff --git a/osm.py b/osm.py index 38e4207..2675ca7 100644 --- a/osm.py +++ b/osm.py @@ -2,7 +2,7 @@ title: OpenStreetMap Tool author: projectmoon author_url: https://git.agnos.is/projectmoon/open-webui-filters -version: 1.1.1 +version: 1.1.2 license: AGPL-3.0+ required_open_webui_version: 0.3.21 requirements: openrouteservice @@ -587,10 +587,15 @@ class OsmSearcher: 'From': self.valves.from_header } - async def event_resolving(self, done: bool=False, message="OpenStreetMap: resolving..."): + async def event_resolving(self, done: bool=False): if not self.event_emitter or not self.valves.status_indicators: return + if done: + message = "OpenStreetMap: resolution complete." + else: + message = "OpenStreetMap: resolving..." + await self.event_emitter({ "type": "status", "data": { @@ -826,7 +831,7 @@ class OsmSearcher: response = requests.get(url, params=params, headers=headers) if response.status_code == 200: - await self.event_resolving(done=True, message="OpenStreetMap: resolution complete.") + await self.event_resolving(done=True) data = response.json() if not data: