diff --git a/plugins/edsm.py b/plugins/edsm.py index 6753921d..44a75131 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -217,8 +217,8 @@ def credentials(cmdr): def journal_entry(cmdr, is_beta, system, station, entry, state): - if entry['event'] == 'CarrierJump': - logger.debug(f'''CarrierJump + if entry['event'] in ('CarrierJump', 'FSDJump'): + logger.debug(f'''{entry["event"]} Commander: {cmdr} System: {system} Station: {station} @@ -300,8 +300,8 @@ entry: {entry!r}''' materials.update(transient) this.queue.put((cmdr, materials)) - if entry['event'] == 'CarrierJump': - logger.debug(f'''CarrierJump + if entry['event'] in ('CarrierJump', 'FSDJump'): + logger.debug(f'''{entry["event"]} Queueing: {entry!r}''' ) this.queue.put((cmdr, entry)) @@ -359,12 +359,12 @@ def worker(): retrying = 0 while retrying < 3: try: - if item and entry['event'] == 'CarrierJump': - logger.debug('CarrierJump') + if item and entry['event'] in ('CarrierJump', 'FSDJump'): + logger.debug(f'{entry["event"]}') if item and entry['event'] not in this.discardedEvents: - if entry['event'] == 'CarrierJump': - logger.debug(f'CarrierJump event not in discarded list') + if entry['event'] in ('CarrierJump', 'FSDJump'): + logger.debug(f'{entry["event"]} event not in discarded list') pending.append(entry) # Get list of events to discard @@ -377,8 +377,8 @@ def worker(): pending = [x for x in pending if x['event'] not in this.discardedEvents] # Filter out unwanted events if should_send(pending): - if any([p for p in pending if p['event'] == 'CarrierJump']): - logger.debug('CarrierJump in pending and it passed should_send()') + if any([p for p in pending if p['event'] in ('CarrierJump', 'FSDJump')]): + logger.debug('CarrierJump (or FSDJump) in pending and it passed should_send()') (username, apikey) = credentials(cmdr) data = { @@ -389,10 +389,10 @@ def worker(): 'message': json.dumps(pending, ensure_ascii=False).encode('utf-8'), } - if any([p for p in pending if p['event'] == 'CarrierJump']): + if any([p for p in pending if p['event'] in ('CarrierJump', 'FSDJump')]): data_elided = data.copy() data_elided['apiKey'] = '<elided>' - logger.debug(f'''CarrierJump: Attempting API call + logger.debug(f'''CarrierJump (or FSDJump): Attempting API call data: {data_elided!r}''' ) r = this.session.post('https://www.edsm.net/api-journal-v1', data=data, timeout=_TIMEOUT)