Browse Source

Fix other filenames

pull/46/head
coomdev 2 years ago
parent
commit
15bbb06479
  1. 4
      src/pomf.ts

4
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) {

Loading…
Cancel
Save