diff --git a/monitor.py b/monitor.py index a1162015..f1542264 100644 --- a/monitor.py +++ b/monitor.py @@ -360,7 +360,7 @@ class EDLogs(FileSystemEventHandler): self.systemaddress = None self.missioncargo = {} self.started = timegm(strptime(entry['timestamp'], '%Y-%m-%dT%H:%M:%SZ')) - self.state.update({ + self.state.update({ # Don't set Ship, ShipID etc since this will reflect Fighter or SRV if starting in those 'Captain' : None, 'Credits' : entry['Credits'], 'Loan' : entry['Loan'], @@ -396,7 +396,7 @@ class EDLogs(FileSystemEventHandler): self.state['ModulesValue'] = None self.state['Rebuy'] = None self.state['Modules'] = None - elif entry['event'] == 'Loadout': + elif entry['event'] == 'Loadout': # Not generated if in Fighter or SRV self.state['ShipID'] = entry['ShipID'] self.state['ShipIdent'] = entry['ShipIdent'] self.state['ShipName'] = entry['ShipName'] diff --git a/plugins/inara.py b/plugins/inara.py index 41387fea..18d09214 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -250,13 +250,14 @@ def journal_entry(cmdr, is_beta, system, station, entry, state): ])) # Update ship - if (entry['event'] in ['StartUp', 'Cargo'] or - (entry['event'] == 'Loadout' and this.shipswap) or - this.newuser): + if (state['ShipID'] and # Unknown if started in Fighter or SRV + (entry['event'] in ['StartUp', 'Cargo'] or + (entry['event'] == 'Loadout' and this.shipswap) or + this.newuser)): data = OrderedDict([ ('shipType', state['ShipType']), ('shipGameID', state['ShipID']), - ('shipName', state['ShipName']), # Can be None + ('shipName', state['ShipName']), # Can be None ('shipIdent', state['ShipIdent']), # Can be None ('isCurrentShip', True), ]) @@ -278,8 +279,6 @@ def journal_entry(cmdr, is_beta, system, station, entry, state): OrderedDict([ ('starsystemName', system), ('stationName', station), # Can be None - ('shipType', state['ShipType']), - ('shipGameID', state['ShipID']), ])) elif entry['event'] == 'Docked':