This commit is contained in:
程序员阿江(Relakkes)
2026-02-03 20:35:33 +08:00
parent 413b5d9034
commit fb42ab5b60

View File

@@ -113,6 +113,8 @@ class ZhihuDbStoreImplement(AbstractStore):
if hasattr(existing_content, key):
setattr(existing_content, key, value)
else:
if "add_ts" not in content_item:
content_item["add_ts"] = utils.get_current_timestamp()
new_content = ZhihuContent(**content_item)
session.add(new_content)
await session.commit()
@@ -133,6 +135,8 @@ class ZhihuDbStoreImplement(AbstractStore):
if hasattr(existing_comment, key):
setattr(existing_comment, key, value)
else:
if "add_ts" not in comment_item:
comment_item["add_ts"] = utils.get_current_timestamp()
new_comment = ZhihuComment(**comment_item)
session.add(new_comment)
await session.commit()
@@ -153,6 +157,8 @@ class ZhihuDbStoreImplement(AbstractStore):
if hasattr(existing_creator, key):
setattr(existing_creator, key, value)
else:
if "add_ts" not in creator:
creator["add_ts"] = utils.get_current_timestamp()
new_creator = ZhihuCreator(**creator)
session.add(new_creator)
await session.commit()