Skip to content

Commit 205f332

Browse files
committed
polish code
1 parent f9fc27e commit 205f332

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

assets/option/option_test_api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ plugins:
2727
proxy_client_key: photo_concurrent_fetcher_proxy
2828
whitelist: [ api, ]
2929

30-
- plugin: advanced-retry
30+
- plugin: advanced_retry
3131
kwargs:
3232
retry_config:
3333
retry_rounds: 3 # 一共对域名列表重试3轮

src/jmcomic/jm_plugin.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ def new_decide_dir(photo, ensure_exists=True) -> str:
12191219

12201220

12211221
class AdvancedRetryPlugin(JmOptionPlugin):
1222-
plugin_key = 'advanced-retry'
1222+
plugin_key = 'advanced_retry'
12231223

12241224
def __init__(self, option: JmOption):
12251225
super().__init__(option)
@@ -1309,7 +1309,7 @@ def failed_count(client: JmcomicClient, domain: str) -> int:
13091309

13101310

13111311
class DownloadCoverPlugin(JmOptionPlugin):
1312-
plugin_key = 'download-cover'
1312+
plugin_key = 'download_cover'
13131313

13141314
def invoke(self,
13151315
dir_rule: dict,
@@ -1324,4 +1324,7 @@ def invoke(self,
13241324
None, None, None,
13251325
dir_rule
13261326
)
1327+
if self.option.download.cache and os.path.exists(save_path):
1328+
self.log(f'album-{album_id}的封面已存在,跳过下载: [{save_path}]', 'skip')
1329+
return
13271330
downloader.client.download_album_cover(album_id, save_path, size)

0 commit comments

Comments
 (0)