Skip to content

Commit 1a4961c

Browse files
committed
fix(jmi): respect send_cover_preview config setting
- /jmi command now checks send_cover_preview before fetching cover - Both /jmi and /jm respect the config when disabled
1 parent 87bc225 commit 1a4961c

3 files changed

Lines changed: 24 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
所有版本更新记录。
44

5+
## **v2.4.1** (2025-12-27)
6+
7+
### Bug 修复
8+
- 修复 `/jmi` 指令不遵循 `send_cover_preview` 配置的问题
9+
- 现在关闭封面预览配置后,`/jmi``/jm` 都不会发送封面图片
10+
11+
---
12+
513
## **v2.4.0** (2025-12-27)
614

715
### 新增功能

main.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"jm_cosmos2",
2323
"GEMILUXVII",
2424
"JM漫画下载插件 - 支持搜索、下载禁漫天堂的漫画本子,支持加密PDF/ZIP打包",
25-
"2.4.0",
25+
"2.4.1",
2626
"https://github.com/GEMILUXVII/jm_cosmos2",
2727
)
2828
class JMCosmosPlugin(Star):
@@ -351,17 +351,20 @@ async def info_command(self, event: AstrMessageEvent, album_id: str = None):
351351
yield event.plain_result(MessageFormatter.format_error("not_found"))
352352
return
353353

354-
# 获取封面图片
355-
cover_dir = self.config_manager.download_dir / "covers"
356-
cover_path = await self.browser.get_album_cover(album_id, cover_dir)
357-
358-
if cover_path and cover_path.exists():
359-
yield event.chain_result(
360-
[
361-
Comp.Image(file=str(cover_path)),
362-
Comp.Plain(MessageFormatter.format_album_info(detail)),
363-
]
364-
)
354+
# 根据配置决定是否发送封面图片
355+
if self.config_manager.send_cover_preview:
356+
cover_dir = self.config_manager.download_dir / "covers"
357+
cover_path = await self.browser.get_album_cover(album_id, cover_dir)
358+
359+
if cover_path and cover_path.exists():
360+
yield event.chain_result(
361+
[
362+
Comp.Image(file=str(cover_path)),
363+
Comp.Plain(MessageFormatter.format_album_info(detail)),
364+
]
365+
)
366+
else:
367+
yield event.plain_result(MessageFormatter.format_album_info(detail))
365368
else:
366369
yield event.plain_result(MessageFormatter.format_album_info(detail))
367370

metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: jm_cosmos2
22
desc: JM漫画下载插件 - 支持搜索、下载禁漫天堂的漫画本子,基于jmcomic库,支持加密PDF/ZIP打包
3-
version: v2.4.0
3+
version: v2.4.1
44
author: GEMILUXVII
55
repo: https://github.com/GEMILUXVII/astrbot_plugin_jm_cosmos

0 commit comments

Comments
 (0)