this.frame = None
this.edsm_session = None
this.edsm_data = None
+this.cache = {}
def plugin_start():
return 'MissingArrivalStar'
return query_arrival_star(data['lastSystem']['name'])
def query_arrival_star(system):
- thread = threading.Thread(target = edsm_query, name = 'EDSM query', args = (system,))
- thread.daemon = True
- thread.start()
+ if system in this.cache:
+ arrival_star_known(this.cache[system])
+ else:
+ thread = threading.Thread(target = edsm_query, name = 'EDSM query', args = (system,))
+ thread.daemon = True
+ thread.start()
def edsm_query(system):
if not this.edsm_session:
if star is None:
arrival_star_unknown()
else:
+ this.cache[this.edsm_data.get('name')] = star['type']
arrival_star_known(star['type'])