Skip to content

Commit

Permalink
feat: add support for old and johnwick filtering options
Browse files Browse the repository at this point in the history
  • Loading branch information
tmchow committed May 23, 2024
1 parent 3e4ee2e commit a4dd2dd
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lambda/generator/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ app.get('/*', (req, res) => {

const grayscale = /[g]/.test(options);
const young = /[y]/.test(options);
const old = /[o]/.test(options);
const johnWick = /[jw]/.test(options);

let getPhotoAttempts = 0;
const getPhoto = () => {
Expand All @@ -39,6 +41,8 @@ app.get('/*', (req, res) => {

if (
(young === true && chosenPhoto.young !== true) ||
(old === true && chosenPhoto.old !== true) ||
(johnWick === true && chosenPhoto['john-wick'] !== true) ||
(ratio < 0.75 && chosenPhotoRatio > 1) ||
(ratio > 1.25 && chosenPhotoRatio < 1)
) {
Expand Down
Loading

0 comments on commit a4dd2dd

Please sign in to comment.