From 15bdb694cc182b06c4826158b15ec5a9fd69d69c Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sat, 9 Mar 2024 17:43:21 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/site.py | 4 ++-- app/chain/subscribe.py | 37 ++++++++----------------------------- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/app/chain/site.py b/app/chain/site.py index a6ef86fc..6fc652cf 100644 --- a/app/chain/site.py +++ b/app/chain/site.py @@ -370,11 +370,11 @@ class SiteChain(ChainBase): if site.render: render_str = "🧭" else: - render_str = "⚠️" + render_str = "" if site.is_active: messages.append(f"{site.id}. {site.name} {render_str}") else: - messages.append(f"{site.id}. {site.name} ") + messages.append(f"{site.id}. {site.name} ⚠️") # 发送列表 self.post_message(Notification( channel=channel, diff --git a/app/chain/subscribe.py b/app/chain/subscribe.py index 74f52734..00edcc0c 100644 --- a/app/chain/subscribe.py +++ b/app/chain/subscribe.py @@ -856,39 +856,18 @@ class SubscribeChain(ChainBase): f"\n- 删除订阅:/subscribe_delete [id]" \ f"\n- 搜索订阅:/subscribe_search [id]" \ f"\n- 刷新订阅:/subscribe_refresh" - medias = [] + messages = [] for subscribe in subscribes: - media = MediaInfo() if subscribe.type == MediaType.MOVIE.value: - media.from_dict({ - "type": subscribe.type, - "title": subscribe.name, - "year": subscribe.year, - "tmdb_id": subscribe.tmdbid, - "backdrop_path": subscribe.backdrop, - "poster_path": subscribe.poster, - "vote_average": subscribe.vote, - "overview": subscribe.description, - }) + messages.append(f"{subscribe.id}. {subscribe.name}({subscribe.year})") else: - media.from_dict({ - "type": subscribe.type, - "name": subscribe.name, - "year": subscribe.year, - "tmdb_id": subscribe.tmdbid, - "backdrop_path": subscribe.backdrop, - "poster_path": subscribe.poster, - "vote_average": f"{subscribe.total_episode - (subscribe.lack_episode or subscribe.total_episode)}" - f"/{subscribe.total_episode}", - "overview": subscribe.description, - "season": subscribe.season - }) - medias.append(media) + messages.append(f"{subscribe.id}. {subscribe.name}({subscribe.year})" + f"第{subscribe.season}季 " + f"[{subscribe.total_episode - (subscribe.lack_episode or subscribe.total_episode)}" + f"/{subscribe.total_episode}]") # 发送列表 - self.post_medias_message( - message=Notification(channel=channel, title=title, userid=userid), - medias=medias - ) + self.post_message(Notification(channel=channel, + title=title, text='\n'.join(messages), userid=userid)) def remote_delete(self, arg_str: str, channel: MessageChannel, userid: Union[str, int] = None): """