Skip to content

Commit

Permalink
fix(route): adds release year filters to metacritic (#16097)
Browse files Browse the repository at this point in the history
* adds release year filters to metacritic

* removes whitespace

* fixes whitespace again.

* tidies new metacritic feature URLSearchParams method
  • Loading branch information
matt-parish authored Jul 6, 2024
1 parent b12f3fb commit 7f4fa88
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/routes/metacritic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ async function handler(ctx) {

const genres = currentUrlParams.getAll('genre').join(',').toLowerCase();
const releaseTypes = currentUrlParams.getAll('releaseType').join(',');
const releaseYearMin = currentUrlParams.get('releaseYearMin');
const releaseYearMax = currentUrlParams.get('releaseYearMax');

if (genres) {
searchParams.genres = genres;
Expand All @@ -51,6 +53,14 @@ async function handler(ctx) {
searchParams.releaseType = releaseTypes;
}

if (releaseYearMin) {
searchParams.releaseYearMin = releaseYearMin;
}

if (releaseYearMax) {
searchParams.releaseYearMax = releaseYearMax;
}

const platforms = currentUrlParams.getAll('platform');
const networks = currentUrlParams.getAll('network');

Expand Down

0 comments on commit 7f4fa88

Please sign in to comment.