fix config for thumbs

whoops

Fix encoded URLs
This commit is contained in:
Thomas Zarebczan 2021-10-12 20:31:10 -04:00
parent 2b5d32c313
commit b49fed4cf5
No known key found for this signature in database
GPG key ID: D505010BDB4364BC
2 changed files with 3 additions and 1 deletions

View file

@ -22,6 +22,7 @@ const config = {
SHARE_DOMAIN_URL: process.env.SHARE_DOMAIN_URL, SHARE_DOMAIN_URL: process.env.SHARE_DOMAIN_URL,
URL: process.env.URL, URL: process.env.URL,
THUMBNAIL_CDN_URL: process.env.THUMBNAIL_CDN_URL, THUMBNAIL_CDN_URL: process.env.THUMBNAIL_CDN_URL,
THUMBNAIL_CARDS_CDN_URL: process.env.THUMBNAIL_CARDS_CDN_URL,
THUMBNAIL_HEIGHT: process.env.THUMBNAIL_HEIGHT, THUMBNAIL_HEIGHT: process.env.THUMBNAIL_HEIGHT,
THUMBNAIL_WIDTH: process.env.THUMBNAIL_WIDTH, THUMBNAIL_WIDTH: process.env.THUMBNAIL_WIDTH,
THUMBNAIL_QUALITY: process.env.THUMBNAIL_QUALITY, THUMBNAIL_QUALITY: process.env.THUMBNAIL_QUALITY,

View file

@ -33,7 +33,8 @@ function getThumbnailCdnUrl(url) {
return url; return url;
} }
if (url) { if (url) {
return `${THUMBNAIL_CARDS_CDN_URL}${btoa(url)}.jpg`; const encodedURL = Buffer.from(url).toString('base64');
return `${THUMBNAIL_CARDS_CDN_URL}${encodedURL}.jpg`;
} }
} }