aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/anonymiseFileNames.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/anonymiseFileNames.ts b/src/plugins/anonymiseFileNames.ts
index 37fd18f..9e69d7a 100644
--- a/src/plugins/anonymiseFileNames.ts
+++ b/src/plugins/anonymiseFileNames.ts
@@ -26,6 +26,8 @@ const enum Methods {
Timestamp,
}
+const tarExtMatcher = /\.tar\.\w+$/;
+
export default definePlugin({
name: "AnonymiseFileNames",
authors: [Devs.obscurity],
@@ -67,7 +69,8 @@ export default definePlugin({
anonymise(file: string) {
let name = "image";
- const extIdx = file.lastIndexOf(".");
+ const tarMatch = tarExtMatcher.exec(file);
+ const extIdx = tarMatch?.index ?? file.lastIndexOf(".");
const ext = extIdx !== -1 ? file.slice(extIdx) : "";
switch (Settings.plugins.AnonymiseFileNames.method) {