Skip to content

Commit fc5d2b9

Browse files
authored
v2.5.29: 修复本子标题尾随空格导致windows创建文件夹失败的bug (#326)
fix #325
1 parent 397d4ab commit fc5d2b9

File tree

6 files changed

+9
-5
lines changed

6 files changed

+9
-5
lines changed

src/jmcomic/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# 被依赖方 <--- 使用方
33
# config <--- entity <--- toolkit <--- client <--- option <--- downloader
44

5-
__version__ = '2.5.28'
5+
__version__ = '2.5.29'
66

77
from .api import *
88
from .jm_plugin import *

src/jmcomic/jm_client_impl.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,9 @@ def fetch_detail_entity(self, jmid, clazz):
709709
})
710710
)
711711

712+
if resp.res_data.get('name') is None:
713+
ExceptionTool.raise_missing(resp, jmid)
714+
712715
return JmApiAdaptTool.parse_entity(resp.res_data, clazz)
713716

714717
def fetch_scramble_id(self, photo_id):

src/jmcomic/jm_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class JmMagicConstants:
7676
APP_TOKEN_SECRET = '18comicAPP'
7777
APP_TOKEN_SECRET_2 = '18comicAPPContent'
7878
APP_DATA_SECRET = '185Hcomic3PAPP7R'
79-
APP_VERSION = '1.7.5'
79+
APP_VERSION = '1.7.6'
8080

8181

8282
# 模块级别共用配置

src/jmcomic/jm_entity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ def __init__(self,
443443
super().__init__()
444444
self.album_id: str = str(album_id)
445445
self.scramble_id: str = str(scramble_id)
446-
self.name: str = name
446+
self.name: str = str(name).strip()
447447
self.page_count: int = int(page_count) # 总页数
448448
self.pub_date: str = pub_date # 发布日期
449449
self.update_date: str = update_date # 更新日期

src/jmcomic/jm_option.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def get_rule_solver(cls, rule: str) -> Optional[RuleSolver]:
159159
return None
160160

161161
def solve_func(detail):
162-
return fix_windir_name(str(DetailEntity.get_dirname(detail, rule[1:])))
162+
return fix_windir_name(str(DetailEntity.get_dirname(detail, rule[1:]))).strip()
163163

164164
return rule[0], solve_func, rule
165165

src/jmcomic/jm_toolkit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ def try_mkdir(cls, save_dir: str):
329329
limit = JmModuleConfig.VAR_FILE_NAME_LENGTH_LIMIT
330330
jm_log('error', f'目录名过长,无法创建目录,强制缩短到{limit}个字符并重试')
331331
save_dir = save_dir[0:limit]
332-
mkdir_if_not_exists(save_dir)
332+
return cls.try_mkdir(save_dir)
333+
raise e
333334
return save_dir
334335

335336

0 commit comments

Comments
 (0)