Update ImageUtilities.plugin.js

This commit is contained in:
Mirco Wittrien 2021-02-12 12:32:20 +01:00
parent 181dae5411
commit 539612bdd8
1 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ module.exports = (_ => {
"info": {
"name": "ImageUtilities",
"author": "DevilBro",
"version": "4.2.7",
"version": "4.2.8",
"description": "Add a handful of options for images/emotes/avatars (direct download, reverse image search, zoom, copy image link, copy image to clipboard, gallery mode)"
},
"changeLog": {
@ -955,7 +955,7 @@ module.exports = (_ => {
isValid (url, type) {
if (!url) return false;
const file = url && (BDFDB.LibraryModules.URLParser.parse(url).pathname || "").toLowerCase();
return file && (!type && (url.startsWith("https://images-ext-2.discordapp.net/") || Object.keys(fileTypes).some(t => file.endsWith(`/${t}`)) || file.endsWith(`.${t}`)) || type && Object.keys(fileTypes).filter(t => fileTypes[t][type]).some(t => file.endsWith(`/${t}`) || file.endsWith(`.${t}`)));
return file && (!type && (url.startsWith("https://images-ext-2.discordapp.net/") || Object.keys(fileTypes).some(t => file.endsWith(`/${t}`) || file.endsWith(`.${t}`))) || type && Object.keys(fileTypes).filter(t => fileTypes[t][type]).some(t => file.endsWith(`/${t}`) || file.endsWith(`.${t}`)));
}
downloadFile (url, path) {