From 0a0984c03a6759607d54b31f2a29f915794ee6b2 Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Tue, 4 Jun 2024 13:04:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/dbpreprocess/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pywxdump/dbpreprocess/__init__.py b/pywxdump/dbpreprocess/__init__.py index e0128d7..f16e271 100644 --- a/pywxdump/dbpreprocess/__init__.py +++ b/pywxdump/dbpreprocess/__init__.py @@ -53,9 +53,8 @@ def get_recent_user_list(MicroMsg_db_path, OpenIMContact_db_path=None, limit=200 return [] parsing_micromsg = ParsingMicroMsg(MicroMsg_db_path) recent_users = parsing_micromsg.recent_chat_wxid() # [{"wxid": username, "LastReadedCreateTime": LastReadedCreateTime, "LastReadedSvrId": LastReadedSvrId},] - recent_users = pd.DataFrame(recent_users) - recent_users = recent_users.sort_values(by="LastReadedCreateTime", - ascending=False) if not recent_users.empty else recent_users + recent_users = pd.DataFrame(recent_users, columns=["wxid", "LastReadedCreateTime", "LastReadedSvrId"]) + recent_users = recent_users.sort_values(by="LastReadedCreateTime", ascending=False) recent_users = recent_users.drop_duplicates(subset=["wxid"], keep="first").head(limit) users = get_user_list(MicroMsg_db_path, OpenIMContact_db_path)