Fix Patch

This commit is contained in:
thororen1234 2025-06-04 20:46:38 -04:00
parent 7618040739
commit 5dd3d60cd7
No known key found for this signature in database

View file

@ -34,23 +34,20 @@ export default definePlugin({
patches: [ patches: [
// Taken from AnonymiseFileNames // Taken from AnonymiseFileNames
{ {
find: 'type:"UPLOAD_START"', find: "async uploadFiles(",
replacement: { replacement: [
match: /await \i\.uploadFiles\((\i),/,
replace: "$1.forEach($self.fixExt),$&"
},
predicate: () => !Settings.plugins.AnonymiseFileNames.enabled,
},
// Also taken from AnonymiseFileNames
{ {
find: "FirstThreadMessage,options", match: /async uploadFiles\((\i),\i\){/,
replacement: { replace: "$&$1.forEach($self.anonymise);"
match: /\i.uploadFilesSimple\((\i)\);/,
replace: "$&$1.forEach($self.fixExt);",
}, },
predicate: () => !Settings.plugins.AnonymiseFileNames.enabled, {
match: /async uploadFilesSimple\((\i)\){/,
replace: "$&$1.forEach($self.anonymise);"
} }
], ],
predicate: () => !Settings.plugins.AnonymiseFileNames.enabled,
},
],
fixExt(upload: ExtUpload) { fixExt(upload: ExtUpload) {
const file = upload.filename; const file = upload.filename;
const tarMatch = tarExtMatcher.exec(file); const tarMatch = tarExtMatcher.exec(file);