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 = []
components = result["components"]
if "city" in components:
name_parts.append(components["city"])
if "state" in components:
name_parts.append(components["state"])
if "country" in components:
name_parts.append(components["country"])
for part in ["town", "city", "state", "country"]:
if part in components:
name_parts.append(components[part])
if not name_parts:
name_parts.append(result["formatted"])