@@ -36,7 +36,7 @@ def build(cls, option: JmOption) -> 'JmOptionPlugin':
3636 return cls (option )
3737
3838 def log (self , msg , topic = None ):
39- if self .log_enable :
39+ if not self .log_enable :
4040 return
4141
4242 jm_log (
@@ -136,7 +136,7 @@ def decide_filepath(self,
136136 filepath = os .path .join (base_dir , DirRule .apply_rule_to_filename (album , photo , filename_rule ) + fix_suffix (suffix ))
137137
138138 mkdir_if_not_exists (base_dir )
139- return filepath
139+ return fix_filepath ( filepath )
140140
141141
142142class JmLoginPlugin (JmOptionPlugin ):
@@ -380,7 +380,9 @@ def zip_photo(self, photo, image_list: list, zip_path: str, path_to_delete, encr
380380 relpath = os .path .relpath (abspath , photo_dir )
381381 f .write (abspath , relpath )
382382
383- self .log (f'压缩章节[{ photo .photo_id } ]成功 → { zip_path } ' , 'finish' )
383+ # 打印结果
384+ self .log (f'{ photo .alias_cn ()} 压缩成功!'
385+ f'[{ photo } ] → [{ zip_path } ]' , 'finish' )
384386 path_to_delete .append (self .unified_path (photo_dir ))
385387
386388 @staticmethod
@@ -403,7 +405,9 @@ def zip_album(self, album, photo_dict: dict, zip_path, path_to_delete, encrypt_d
403405 abspath = os .path .join (photo_dir , file )
404406 relpath = os .path .relpath (abspath , album_dir )
405407 f .write (abspath , relpath )
406- self .log (f'压缩本子[{ album .album_id } ]成功 → { zip_path } ' , 'finish' )
408+ # 打印结果
409+ self .log (f'{ album .alias_cn ()} 压缩成功!'
410+ f'[{ album } ] → [{ zip_path } ]' , 'finish' )
407411
408412 def after_zip (self , path_to_delete : List [str ]):
409413 # 删除所有原文件
@@ -786,7 +790,13 @@ def invoke(self,
786790 if not result :
787791 return
788792 img_path_ls , img_dir_ls = result
789- self .log (f'Convert Successfully: JM{ album or photo } → { pdf_filepath } ' )
793+
794+ # noinspection PyTypeChecker
795+ detail : DetailEntity = album or photo
796+
797+ # 打印结果
798+ self .log (f'{ detail .alias_cn ()} 合并PDF成功!'
799+ f'[{ detail } ] → [{ pdf_filepath } ]' , 'finish' )
790800
791801 # 执行删除
792802 img_path_ls += img_dir_ls
@@ -863,7 +873,12 @@ def invoke(self,
863873 img_path_ls = self .write_img_2_long_img (long_img_path , album , photo )
864874 if not img_path_ls :
865875 return
866- self .log (f'Convert Successfully: JM{ album or photo } → { long_img_path } ' )
876+ # noinspection PyTypeChecker
877+ detail : DetailEntity = album or photo
878+
879+ # 打印结果
880+ self .log (f'{ detail .alias_cn ()} 合并长图成功!'
881+ f'[{ detail } ] → [{ long_img_path } ]' , 'finish' )
867882
868883 # 执行删除
869884 self .execute_deletion (img_path_ls )
0 commit comments