From 15bbb064796c4dd1ed636d46afdbdde6b803fa0d Mon Sep 17 00:00:00 2001 From: coomdev Date: Thu, 13 Jan 2022 08:44:47 +0100 Subject: [PATCH] Fix other filenames --- src/pomf.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pomf.ts b/src/pomf.ts index e770721..d0b31dd 100644 --- a/src/pomf.ts +++ b/src/pomf.ts @@ -16,12 +16,12 @@ settings.subscribe(b => { }); const getExt = (fn: string) => { - const isDum = fn!.match(/^([a-z0-9]{6}\.(?:jpe?g|png|webm|gif))/gi); + const isDum = fn!.match(/^[a-z0-9]{6}\./i); const isB64 = fn!.match(/^((?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=))?\.(gif|jpe?g|png|webm)/); const isExt = fn!.match(/\[.*=(.*)\]/); let ext; if (isDum) { - ext = isDum[0]; + ext = fn.split('.').slice(0, -1).join('.'); } else if (isB64) { ext = atob(isB64[1]); } else if (isExt) {