mirror of
https://github.com/Equicord/Equicord.git
synced 2025-01-18 13:23:28 -05:00
FixFileExtensions When Anon Temp Disabled
This commit is contained in:
parent
f2c2246d1e
commit
118e8387db
1 changed files with 2 additions and 1 deletions
|
@ -114,15 +114,16 @@ export default definePlugin({
|
|||
}, { noop: true }),
|
||||
|
||||
anonymise(upload: AnonUpload) {
|
||||
if ((upload.anonymise ?? settings.store.anonymiseByDefault) === false) return upload.filename;
|
||||
|
||||
const file = upload.filename;
|
||||
const tarMatch = tarExtMatcher.exec(file);
|
||||
const extIdx = tarMatch?.index ?? file.lastIndexOf(".");
|
||||
const fileName = extIdx !== -1 ? file.substring(0, extIdx) : "";
|
||||
let ext = extIdx !== -1 ? file.slice(extIdx) : "";
|
||||
if (Settings.plugins.FixFileExtensions.enabled) {
|
||||
ext = reverseExtensionMap[ext];
|
||||
}
|
||||
if ((upload.anonymise ?? settings.store.anonymiseByDefault) === false) return fileName + ext;
|
||||
|
||||
switch (settings.store.method) {
|
||||
case Methods.Random:
|
||||
|
|
Loading…
Reference in a new issue