Skip to content

Commit

Permalink
Merge pull request #202 from KenEucker/develop
Browse files Browse the repository at this point in the history
3.1.3
  • Loading branch information
KenEucker authored Nov 10, 2023
2 parents faedb70 + 5d3360d commit 034d1b6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "biketag",
"version": "3.1.2",
"version": "3.1.3",
"description": "The Javascript client API for BikeTag Games",
"main": "./biketag.node.js",
"browser": "./biketag.js",
Expand Down
2 changes: 1 addition & 1 deletion src/imgur/getGame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function getGame(
const cacheKey = `imgur::${cacheKeys.gameIdText}${
payload.slug ?? payload.name ?? 'biketag'
}`
let game = getCacheIfExists(cacheKey, cache)
let game = payload.cached ? getCacheIfExists(cacheKey, cache) : null
let error
let success = true

Expand Down
6 changes: 4 additions & 2 deletions src/imgur/getPlayers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ export async function getPlayers(

if (client) {
const { data: tags } = await this.getTags({ sort: 'relevance' })
const albumInfo = await getGameAlbumFromCache(payload.hash, cache, () =>
client.getAlbum(payload.hash)
const albumInfo = await getGameAlbumFromCache(
payload.hash,
payload.cached ? cache : undefined,
() => client.getAlbum(payload.hash)
)
const playerImages = albumInfo.data?.images?.reduce((o, i) => {
const player = getPlayerDataFromText(i.description)
Expand Down
6 changes: 4 additions & 2 deletions src/imgur/getQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ export async function getQueue(
payload.queuehash = game.data.queuehash
}
}
const albumInfo = await getGameAlbumFromCache(payload.queuehash, cache, () =>
client.getAlbum(payload.queuehash)
const albumInfo = await getGameAlbumFromCache(
payload.queuehash,
payload.cached ? cache : undefined,
() => client.getAlbum(payload.queuehash)
)

const images = getGroupedImagesByTagnumber(albumInfo?.data?.images, cache)
Expand Down
6 changes: 4 additions & 2 deletions src/imgur/getTags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ export async function getTags(
let error
let success = true

const albumInfo = await getGameAlbumFromCache(payload.hash, cache, () =>
client.getAlbum(payload.hash)
const albumInfo = await getGameAlbumFromCache(
payload.hash,
payload.cached ? cache : undefined,
() => client.getAlbum(payload.hash)
)

if (payload.tagnumbers?.length) {
Expand Down

0 comments on commit 034d1b6

Please sign in to comment.