OSM: fix misleading resolve message (again).

This commit is contained in:
projectmoon 2024-11-22 13:11:05 +01:00
parent 234f75854c
commit aaccefb5a5
2 changed files with 12 additions and 3 deletions

View File

@ -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.

11
osm.py
View File

@ -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: