export function imgurl(channel, file) { if (file.mime === "image/svg+xml") { return fileurl(channel, file); } return channel.filesUrl + `/thumbs/${file.path}`; } export function fileurl(channel, file) { return channel.filesUrl + `/${file.path}`; } export function htmlurl(channel, file, preset) { let html = ""; let url = fileurl(channel, file); if (file.width > 0) { let presetUrl = url; if (preset) { presetUrl = channel.filesUrl + `/templates/${preset}/${file.path}`; } html = `${file.path}`; } else if (file.mime === "image/svg+xml") { html = `${file.path}`; } else { html = `${file.originalName}`; } return html; }