add _id to replays JSON read from the filesystem

This commit is contained in:
Jylpah committed 2020-11-26 21:29:17 +02:00
1 parent fe7292a588
commit c830955b6f
1 file changed
+6
+6
View File
@@ -1994,6 +1994,12 @@ async def mk_readerQ_item(replay_json, filename : str = None) -> list:
"""Make an item to replay queue""" """Make an item to replay queue"""
global REPLAY_N global REPLAY_N
REPLAY_N +=1 REPLAY_N +=1
try:
if not '_id' in replay_json:
id = wi.read_replay_id(replay_json)
replay_json['_id'] = id
except Exception as err:
bu.error(exception=err)
if filename == None: if filename == None:
return [replay_json, REPLAY_N, '' ] return [replay_json, REPLAY_N, '' ]
elif RE_SRC_IS_DB.match(filename) != None: elif RE_SRC_IS_DB.match(filename) != None: