diff --git a/store/zhihu/_store_impl.py b/store/zhihu/_store_impl.py index cd01552..6d029a4 100644 --- a/store/zhihu/_store_impl.py +++ b/store/zhihu/_store_impl.py @@ -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()