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

Method update_comment

store/xhs/_store_impl.py:213–222  ·  view source on GitHub ↗
(self, session: AsyncSession, comment_item: Dict)

Source from the content-addressed store, hash-verified

211 session.add(comment)
212
213 async def update_comment(self, session: AsyncSession, comment_item: Dict):
214 comment_id = comment_item.get("comment_id")
215 last_modify_ts = int(get_current_timestamp())
216 update_data = {
217 "last_modify_ts": last_modify_ts,
218 "like_count": str(comment_item.get("like_count")),
219 "sub_comment_count": int(comment_item.get("sub_comment_count", 0) or 0),
220 }
221 stmt = update(XhsNoteComment).where(XhsNoteComment.comment_id == comment_id).values(**update_data)
222 await session.execute(stmt)
223
224 async def comment_is_exist(self, session: AsyncSession, comment_id: str) -> bool:
225 stmt = select(XhsNoteComment).where(XhsNoteComment.comment_id == comment_id)

Callers 1

store_commentMethod · 0.95

Calls 2

get_current_timestampFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected