AnonymiseFileNames: Properly keep .tar.* extensions
This commit is contained in:
parent
742f5cf556
commit
fe80b8cc85
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user