add ${page} to download subpath

This commit is contained in:
wgh19
2024-05-17 18:00:21 +08:00
parent 1fecb8d55d
commit 811b7b4ed8
3 changed files with 7 additions and 2 deletions

View File

@@ -128,7 +128,8 @@
"Delete all": "删除全部",
"Related": "相关",
"Related artworks": "相关作品",
"Related users": "相关用户"
"Related users": "相关用户",
"Replace with '-p${index}' if the work have more than one images, otherwise replace with blank.": "替换为'-p${index}'如果作品有多张图片, 否则替换为空白"
},
"zh_TW": {
"Search": "搜索",
@@ -259,6 +260,7 @@
"Delete all": "刪除全部",
"Related": "相關",
"Related artworks": "相關作品",
"Related users": "相關用戶"
"Related users": "相關用戶",
"Replace with '-p${index}' if the work have more than one images, otherwise replace with blank.": "替換為'-p${index}'如果作品有多張圖片, 否則替換為空白"
}
}

View File

@@ -131,6 +131,8 @@ class DownloadingTask {
subPathPatten = subPathPatten.replaceAll(r"${title}", illust.title);
subPathPatten = subPathPatten.replaceAll(r"${author}", illust.author.name);
subPathPatten = subPathPatten.replaceAll(r"${index}", index.toString());
subPathPatten = subPathPatten.replaceAll(r"${page}",
illust.images.length == 1 ? "" : "-p$index");
subPathPatten = subPathPatten.replaceAll(r"${ext}", ext);
subPathPatten = subPathPatten.replaceAll(r"${AI}", illust.isAi ? "AI" : "");
List<String> extractTags(String input) {

View File

@@ -408,6 +408,7 @@ ${"Some keywords will be replaced by the following rule:".tl}
\${author} -> ${"Name of the author".tl}
\${id} -> ${"Artwork ID".tl}
\${index} -> ${"Index of the image in the artwork".tl}
\${page} -> ${"Replace with '-p\${index}' if the work have more than one images, otherwise replace with blank.".tl}
\${ext} -> ${"File extension".tl}
\${AI} -> ${"Replace with 'AI' if the work was generated by AI, otherwise replace with blank".tl}
\${tag(*)} -> ${"Replace with * if the work have tag *, otherwise replace with blank.".tl}