diff --git a/assets/tr.json b/assets/tr.json index d3cb6b9..74ffe3e 100644 --- a/assets/tr.json +++ b/assets/tr.json @@ -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}'如果作品有多張圖片, 否則替換為空白" } } \ No newline at end of file diff --git a/lib/network/download.dart b/lib/network/download.dart index c68f325..5c81505 100644 --- a/lib/network/download.dart +++ b/lib/network/download.dart @@ -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 extractTags(String input) { diff --git a/lib/pages/settings_page.dart b/lib/pages/settings_page.dart index ec266ed..69d3edc 100644 --- a/lib/pages/settings_page.dart +++ b/lib/pages/settings_page.dart @@ -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}