reinstate thumbor with new URL

This commit is contained in:
bingus_violet 2024-06-10 18:27:49 -05:00
parent 86440517b1
commit d13fdc8927

View file

@ -87,7 +87,7 @@ var cachedImages = JSON.parse(fs.readFileSync(cacheFile))
var constants = JSON.parse(fs.readFileSync(path.join(__dirname, "constants.json"))) var constants = JSON.parse(fs.readFileSync(path.join(__dirname, "constants.json")))
var activityImages = constants.activityImages var activityImages = constants.activityImages
var thumborURL = "https://thumbor.violets-purgatory.dev/unsafe/" var thumborURL = "https://thumbor-production-0e82.up.railway.app/"
var imgExtension = "png" var imgExtension = "png"
var thumborArgs = `filters:format(${imgExtension})/` var thumborArgs = `filters:format(${imgExtension})/`
@ -190,7 +190,7 @@ function socketeer() {
var fp = path.join(imgCache, fn) var fp = path.join(imgCache, fn)
if (!cachedImages.imgs[url]) { if (!cachedImages.imgs[url]) {
const response = await (await fetch(url)).arrayBuffer() const response = await (await fetch(thumborURL + imgRes + thumborArgs + url)).arrayBuffer()
fs.writeFileSync(fp, Buffer.from(response)) fs.writeFileSync(fp, Buffer.from(response))
cachedImages.imgs[url] = { cachedImages.imgs[url] = {