From bca3d63ffed6e0e14978a1006840d7c2151d3f74 Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Sat, 27 Jan 2018 16:19:35 +0000 Subject: [PATCH] Check that EDShipyard and Coriolis links shouldn't be discarded --- plugins/edsm.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/plugins/edsm.py b/plugins/edsm.py index c53c1a17..ee18f731 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -254,12 +254,14 @@ def cmdr_data(data, is_beta): if ship != this.lastship: cmdr = data['commander']['name'] timestamp = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime()) - this.queue.put((cmdr, { - 'event': 'Coriolis', 'timestamp': timestamp, '_shipId': data['ship']['id'], 'url': coriolis.url(data, is_beta) - })) - this.queue.put((cmdr, { - 'event': 'EDShipyard', 'timestamp': timestamp, '_shipId': data['ship']['id'], 'url': edshipyard.url(data, is_beta) - })) + if 'Coriolis' not in this.discardedEvents: + this.queue.put((cmdr, { + 'event': 'Coriolis', 'timestamp': timestamp, '_shipId': data['ship']['id'], 'url': coriolis.url(data, is_beta) + })) + if 'EDShipyard' not in this.discardedEvents: + this.queue.put((cmdr, { + 'event': 'EDShipyard', 'timestamp': timestamp, '_shipId': data['ship']['id'], 'url': edshipyard.url(data, is_beta) + })) this.lastship = ship @@ -332,7 +334,7 @@ def worker(): def should_send(entries): for entry in entries: if (entry['event'] not in ['CommunityGoal', # Spammed periodically - 'Cargo', 'Loadout', 'Materials', 'LoadGame', 'Rank', 'Progress', # Will be followed by 'Docked' + 'Cargo', 'Loadout', 'Materials', 'LoadGame', 'Rank', 'Progress', # Will be followed by 'Docked' or 'Location' 'ShipyardBuy', 'ShipyardNew', 'ShipyardSwap'] and # " not (entry['event'] == 'Location' and entry.get('Docked'))): # " return True