mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2026-03-03 04:30:47 +08:00
fix: #826
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user