diff --git a/package.json b/package.json index 239437f..c43e37e 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/imgur/getGame.ts b/src/imgur/getGame.ts index 4332ab7..3177ca6 100644 --- a/src/imgur/getGame.ts +++ b/src/imgur/getGame.ts @@ -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 diff --git a/src/imgur/getPlayers.ts b/src/imgur/getPlayers.ts index e12c555..7004ec5 100644 --- a/src/imgur/getPlayers.ts +++ b/src/imgur/getPlayers.ts @@ -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) diff --git a/src/imgur/getQueue.ts b/src/imgur/getQueue.ts index 81bfe39..6f5eeba 100644 --- a/src/imgur/getQueue.ts +++ b/src/imgur/getQueue.ts @@ -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) diff --git a/src/imgur/getTags.ts b/src/imgur/getTags.ts index 045b644..cd13f18 100644 --- a/src/imgur/getTags.ts +++ b/src/imgur/getTags.ts @@ -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) {