Skip to content

Commit bcb4d86

Browse files
committed
feat(functions): now accepting rotate parameter on the resize function
also includes fixes for game data, and bumps up the checking for new tags to every 15 minutes.
1 parent 457cb23 commit bcb4d86

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

functions/ambassadors.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default async (req: Request) => {
3434
log('[ambassadors] Retrieved game', {
3535
name: game.name,
3636
id: game._id,
37-
region: game.awsRegion ?? 'imgur',
37+
region: game.awsRegion,
3838
})
3939

4040
const biketagPayload = await getPayloadOpts(req, {

functions/resize.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import sharp from 'sharp'
33
import { getPayloadOpts } from './common/methods'
44

55
export default async (req: Request) => {
6-
const { url, width, format = 'webp' } = await getPayloadOpts(req)
6+
const { url, width, format = 'webp', rotate } = await getPayloadOpts(req)
77
const headers: any = {
88
'Cache-Control': 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0',
99
'Access-Control-Allow-Origin': '*',
@@ -33,8 +33,8 @@ export default async (req: Request) => {
3333
const response = await axios.get(url, { responseType: 'arraybuffer' })
3434
const inputBuffer = Buffer.from(response.data)
3535

36-
// Resize and convert (auto-rotate if EXIF orientation is present)
37-
let outputBuffer = sharp(inputBuffer).rotate()
36+
// Resize and convert
37+
let outputBuffer = sharp(inputBuffer).rotate(rotate)
3838

3939
if (widthNum) {
4040
outputBuffer = outputBuffer.resize({ width: widthNum })

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
Access-Control-Allow-Credentials = "true"
4242

4343
[functions."autopost-background"]
44-
schedule = "*/30 * * * *"
44+
schedule = "*/15 * * * *"
4545
included_files=["functions/emails/*.liquid"]
4646

4747
[functions."achievements-background"]

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@vueuse/head": "^2.0.0",
3636
"ajv": "^8.17.1",
3737
"autoprefixer": "^10.4.17",
38-
"biketag": "^3.5.27",
38+
"biketag": "^3.5.29",
3939
"bootstrap": "^5.3.3",
4040
"bootstrap-vue-next": "^0.15.5",
4141
"crypto-js": "^4.2.0",
@@ -72,7 +72,7 @@
7272
"vue3-markdown-it": "^1.0.10"
7373
},
7474
"peerDependencies": {
75-
"biketag": "^3.5.27",
75+
"biketag": "^3.5.29",
7676
"pinia": "^2.0.0",
7777
"vue": "^3.0.0",
7878
"vue-router": "^4.0.0"

src/common/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export const BikeTagEnv = {
4545
IMAGE_SOURCE: process.env.IMAGE_SOURCE ?? BikeTagDefaults.imageSource ?? null,
4646
HOST: process.env.HOST ?? BikeTagDefaults.host ?? null,
4747
BIKETAG_AUTHED: process.env.BIKETAG_AUTHED ?? null,
48+
DEFAULT_IMAGE_SOURCE: process.env.DEFAULT_IMAGE_SOURCE ?? BikeTagDefaults.imageSource ?? 'imgur',
4849
/* Google Configuration */
4950
G_AKEY:
5051
process.env.G_AKEY ?? process.env.GOOGLE_ACCESS_TOKEN ?? process.env.GOOGLE_API_KEY ?? null,

0 commit comments

Comments
 (0)