AnonymiseFileNames: Properly keep .tar.* extensions
This commit is contained in:
parent
742f5cf556
commit
fe80b8cc85
|
@ -26,6 +26,8 @@ const enum Methods {
|
||||||
Timestamp,
|
Timestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tarExtMatcher = /\.tar\.\w+$/;
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "AnonymiseFileNames",
|
name: "AnonymiseFileNames",
|
||||||
authors: [Devs.obscurity],
|
authors: [Devs.obscurity],
|
||||||
|
@ -67,7 +69,8 @@ export default definePlugin({
|
||||||
|
|
||||||
anonymise(file: string) {
|
anonymise(file: string) {
|
||||||
let name = "image";
|
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) : "";
|
const ext = extIdx !== -1 ? file.slice(extIdx) : "";
|
||||||
|
|
||||||
switch (Settings.plugins.AnonymiseFileNames.method) {
|
switch (Settings.plugins.AnonymiseFileNames.method) {
|
||||||
|
|
Loading…
Reference in a new issue