diff options
author | V <vendicated@riseup.net> | 2023-08-12 02:45:11 +0200 |
---|---|---|
committer | V <vendicated@riseup.net> | 2023-08-12 02:45:11 +0200 |
commit | fe80b8cc8586f3119076a99c610f36d7824985a9 (patch) | |
tree | d94b5337ebe29f049a5641470fcd2e75e8ba4e22 /src/plugins | |
parent | 742f5cf556254ac23eb3f74cdbcd691d5ebcb533 (diff) | |
download | Vencord-fe80b8cc8586f3119076a99c610f36d7824985a9.tar.gz Vencord-fe80b8cc8586f3119076a99c610f36d7824985a9.tar.bz2 Vencord-fe80b8cc8586f3119076a99c610f36d7824985a9.zip |
AnonymiseFileNames: Properly keep .tar.* extensions
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/anonymiseFileNames.ts | 5 |
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) { |