Include town name, when available, in user location name

This commit is contained in:
jesopo 2019-06-30 10:41:25 +01:00
parent cb07a5d708
commit 992f16a685

View file

@ -29,12 +29,9 @@ class Module(ModuleManager.BaseModule):
name_parts = [] name_parts = []
components = result["components"] components = result["components"]
if "city" in components: for part in ["town", "city", "state", "country"]:
name_parts.append(components["city"]) if part in components:
if "state" in components: name_parts.append(components[part])
name_parts.append(components["state"])
if "country" in components:
name_parts.append(components["country"])
if not name_parts: if not name_parts:
name_parts.append(result["formatted"]) name_parts.append(result["formatted"])