1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-21 11:27:38 +03:00

Merge pull request from EDCD/fix/1598/eddn-fssisignaldiscovered-empty-array

eddn/fsssignaldiscovered: Catch where no signals pass checks
This commit is contained in:
Athanasius 2022-06-23 10:33:15 +01:00 committed by GitHub
commit e70b51cf03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1396,14 +1396,14 @@ class EDDN:
f"{s['SystemAddress']} != {aug_systemaddress}")
continue
# Remove any _Localised keys (would only be in a USS signal)
s = filter_localised(s)
# Drop Mission USS signals.
if "USSType" in s and s["USSType"] == "$USS_Type_MissionTarget;":
logger.trace_if("plugin.eddn.fsssignaldiscovered", "USSType is $USS_Type_MissionTarget;, dropping")
continue
# Remove any _Localised keys (would only be in a USS signal)
s = filter_localised(s)
# Remove any key/values that shouldn't be there per signal
s.pop('event', None)
s.pop('horizons', None)
@ -1413,6 +1413,12 @@ class EDDN:
msg['message']['signals'].append(s)
if not msg['message']['signals']:
# No signals passed checks, so drop them all and return
logger.debug('No signals after checks, so sending no message')
self.fss_signals = []
return None
# `horizons` and `odyssey` augmentations
msg['message']['horizons'] = entry['horizons']
msg['message']['odyssey'] = entry['odyssey']