MCPcopy Create free account
hub / github.com/NanmiCoder/MediaCrawler / store_comment

Method store_comment

store/xhs/_store_impl.py:182–192  ·  view source on GitHub ↗
(self, comment_item: Dict)

Source from the content-addressed store, hash-verified

180 return result.first() is not None
181
182 async def store_comment(self, comment_item: Dict):
183 if not comment_item:
184 return
185 async with get_session() as session:
186 comment_id = comment_item.get("comment_id")
187 if not comment_id:
188 return
189 if await self.comment_is_exist(session, comment_id):
190 await self.update_comment(session, comment_item)
191 else:
192 await self.add_comment(session, comment_item)
193
194 async def add_comment(self, session: AsyncSession, comment_item: Dict):
195 add_ts = int(get_current_timestamp())

Callers 1

update_xhs_note_commentFunction · 0.45

Calls 5

comment_is_existMethod · 0.95
update_commentMethod · 0.95
add_commentMethod · 0.95
get_sessionFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected