spansh.py: fixed oldstation search results for partial system name

fixes #3
This commit is contained in:
alterNERDtive 2020-06-29 09:25:16 +02:00
parent 79bc2d49d4
commit 0179369fc1

View file

@ -80,10 +80,13 @@ def getOldStationsInSystem(system):
ret = ""
for station in json["results"]:
if args.short:
ret += "{}\n".format(station["name"])
else:
ret += "{} ({})\n".format(station["name"], station["updated_at"])
# systems including the given name as a word will also trigger;
# looking for e.g. “Mari” will also give you stuff in “Mac Mari”!
if station["system_name"] == system:
if args.short:
ret += "{}\n".format(station["name"])
else:
ret += "{} ({})\n".format(station["name"], station["updated_at"])
return ret[:-1]