@@ -106,7 +106,7 @@ def __call__(self, **kwargs):
106106 def invoke (self , option , feature_from = None , ** context ):
107107 """
108108 执行此 Feature 对应的插件。
109- 根据 feature_from 动态适配 filename_rule 和 level 等参数。
109+ 根据 feature_from 动态适配 filename_rule 等参数。
110110 """
111111 pclass = JmModuleConfig .REGISTRY_PLUGIN .get (self .plugin_key )
112112 if pclass is None :
@@ -127,29 +127,24 @@ def _adapt_kwargs(self, feature_from):
127127 """
128128 根据 feature_from 动态适配参数:
129129 - filename_rule 前缀:download_album → A前缀,download_photo → P前缀
130- - level:download_album → 'album',download_photo → 'photo'
131130
132131 注意:用户通过 __call__ 显式传入的参数(记录在 _user_keys 中)不会被适配。
133132 """
134133 kwargs = self .kwargs .copy ()
135134
136135 if feature_from == 'download_album' :
137- # album 模式:P前缀规则 → A前缀规则, level → album
136+ # album 模式:P前缀规则 → A前缀规则
138137 if 'filename_rule' not in self ._user_keys and 'filename_rule' in kwargs :
139138 rule = kwargs ['filename_rule' ]
140139 if rule and rule [0 ] == 'P' :
141140 kwargs ['filename_rule' ] = 'A' + rule [1 :]
142- if 'level' not in self ._user_keys and 'level' in kwargs and kwargs ['level' ] == 'photo' :
143- kwargs ['level' ] = 'album'
144141
145142 elif feature_from == 'download_photo' :
146- # photo 模式:A前缀规则 → P前缀规则, level → photo
143+ # photo 模式:A前缀规则 → P前缀规则
147144 if 'filename_rule' not in self ._user_keys and 'filename_rule' in kwargs :
148145 rule = kwargs ['filename_rule' ]
149146 if rule and rule [0 ] == 'A' :
150147 kwargs ['filename_rule' ] = 'P' + rule [1 :]
151- if 'level' not in self ._user_keys and 'level' in kwargs and kwargs ['level' ] == 'album' :
152- kwargs ['level' ] = 'photo'
153148
154149 return kwargs
155150
@@ -187,9 +182,8 @@ def __repr__(self):
187182
188183
189184# 预定义特性(用插件类的 plugin_key 引用,附带默认参数)
190- # filename_rule 和 level 会根据 feature_from 在 invoke 时动态适配:
191- # download_album → A前缀 + level=album
192- # download_photo → P前缀 + level=photo
185+ # filename_rule 会根据 feature_from 在 invoke 时动态适配 A/P 前缀
186+ # zip 的打包粒度由插件根据上下文(album/photo)自动推导,无需 level 参数
193187Feature .export_pdf = PluginFeature (Img2pdfPlugin .plugin_key , pdf_dir = './' , filename_rule = 'Atitle' )
194- Feature .export_zip = PluginFeature (ZipPlugin .plugin_key , level = 'photo' , zip_dir = './' , filename_rule = 'Ptitle' )
188+ Feature .export_zip = PluginFeature (ZipPlugin .plugin_key , zip_dir = './' , filename_rule = 'Ptitle' )
195189Feature .export_long_img = PluginFeature (LongImgPlugin .plugin_key , img_dir = './' , filename_rule = 'Pid' )
0 commit comments