Skip to content

Commit 8604aee

Browse files
authored
fix data old
1 parent 73a86c0 commit 8604aee

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/export_pictures.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,24 @@ async def export_pictures(url, col, headers):
6767
)
6868
logger.info(f"{col.get('method')}")
6969

70-
if os.path.exists(f'./cache/pictures/taiga_{col.get("params")["type"]}.json.old'):
71-
compare_now = compare_fingerprints(
72-
json.load(open(f'./cache/pictures/taiga_{col.get("params")["type"]}.json.old', 'r', encoding='utf-8'))['data'],
73-
json.load(open(f'./cache/pictures/taiga_{col.get("params")["type"]}.json', 'r', encoding='utf-8'))['data'],
74-
)
75-
76-
if compare_now.__len__() > 0:
77-
logger.info(f'<./cache/pictures/taiga_{col.get("params")["type"]}.json> Datas are different, starting exportation...')
78-
for picture in compare_now:
79-
await export_picture(url, col, headers, picture[0])
80-
else:
81-
logger.info(f'<./cache/pictures/taiga_{col.get("params")["type"]}.json> Datas are the same, nothing to do !')
82-
else:
83-
logger.info(f'<./cache/pictures/taiga_{col.get("params")["type"]}.json> No old file found, starting exportation...')
84-
for picture in data[0][1]:
85-
await export_picture(url, col, headers, picture.get('ident'))
70+
#if os.path.exists(f'./cache/pictures/taiga_{col.get("params")["type"]}.json.old'):
71+
# compare_now = compare_fingerprints(
72+
# json.load(open(f'./cache/pictures/taiga_{col.get("params")["type"]}.json.old', 'r', encoding='utf-8'))['data'],
73+
# json.load(open(f'./cache/pictures/taiga_{col.get("params")["type"]}.json', 'r', encoding='utf-8'))['data'],
74+
# )
75+
#
76+
# if compare_now.__len__() > 0:
77+
# logger.info(f'<./cache/pictures/taiga_{col.get("params")["type"]}.json> Datas are different, starting exportation...')
78+
# for picture in compare_now:
79+
# await export_picture(url, col, headers, picture[0])
80+
# else:
81+
# logger.info(f'<./cache/pictures/taiga_{col.get("params")["type"]}.json> Datas are the same, nothing to do !')
82+
#else:
83+
logger.info(f'<./cache/pictures/taiga_{col.get("params")["type"]}.json> No old file found, starting exportation...')
84+
for picture in data[0][1]:
85+
await export_picture(url, col, headers, picture.get('ident'))
8686

87-
copy_file(f'./cache/pictures/taiga_{col.get("params")["type"]}.json', f'./cache/pictures/taiga_{col.get("params")["type"]}.json.old')
87+
#copy_file(f'./cache/pictures/taiga_{col.get("params")["type"]}.json', f'./cache/pictures/taiga_{col.get("params")["type"]}.json.old')
8888
except requests.exceptions.HTTPError as e:
8989
logger.warning(f"Failed to insert {col.get('method')}: {e} \n {e.response.text}")
9090

0 commit comments

Comments
 (0)