mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-12-02 03:45:25 +03:00
EngineerProgress: Duh, we already checked for the array, this is the array-less form
This was never properly edited after copy/paste from the "we have an array" form.
This commit is contained in:
1 parent
af5ffabd30
commit
6f100a3ebf
1 file changed
+10
-11
+10
-11
@@ -1687,23 +1687,22 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
||||
return False
|
||||
|
||||
if 'Progress' in entry:
|
||||
# Progress can be only a single Engineer, so it's not an array
|
||||
# Progress is only a single Engineer, so it's not an array
|
||||
# { "timestamp":"2021-05-24T17:57:52Z",
|
||||
# "event":"EngineerProgress",
|
||||
# "Engineer":"Felicity Farseer",
|
||||
# "EngineerID":300100,
|
||||
# "Progress":"Invited" }
|
||||
for e in entry.get('Engineers', entry):
|
||||
for f in ('Engineer', 'EngineerID', 'Rank', 'Progress', 'RankProgress'):
|
||||
if f not in e:
|
||||
# For some Progress there's no Rank/RankProgress yet
|
||||
if f in ('Rank', 'RankProgress'):
|
||||
if (progress := e.get('Progress', None)) is not None:
|
||||
if progress in ('Invited', 'Known'):
|
||||
continue
|
||||
for f in ('Engineer', 'EngineerID', 'Rank', 'Progress', 'RankProgress'):
|
||||
if f not in entry:
|
||||
# For some Progress there's no Rank/RankProgress yet
|
||||
if f in ('Rank', 'RankProgress'):
|
||||
if (progress := entry.get('Progress', None)) is not None:
|
||||
if progress in ('Invited', 'Known'):
|
||||
continue
|
||||
|
||||
logger.warning(f"Engineer entry without '{f}' key: {e=} in {entry=}")
|
||||
return False
|
||||
logger.warning(f"Progress event without '{f}' key: {entry=}")
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
Reference in new issue
Block a user