Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions data-asia/S/S-P.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ const set: Set = {

serie: serie,

cardCount: {
official: 0
},
releaseDate: {
id: '2022-07-14',
th: '2022-05-11'
Expand Down
3 changes: 0 additions & 3 deletions data-asia/S/SP5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ const set: Set = {

serie: serie,

cardCount: {
official: 0
},
releaseDate: {
'zh-tw': '2021-08-27'
}
Expand Down
3 changes: 0 additions & 3 deletions data-asia/SM/SM-P.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ const set: Set = {

serie: serie,

cardCount: {
official: 0
},
releaseDate: '2019-10-09'
}

Expand Down
3 changes: 0 additions & 3 deletions data-asia/SV/SV-P.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ const set: Set = {

serie: serie,

cardCount: {
official: 0
},
releaseDate: {
'zh-tw': '2023-01-26',
id: '2023-03-03',
Expand Down
4 changes: 0 additions & 4 deletions data/Pokémon TCG Pocket/Promos-A.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ const set: Set = {

serie: serie,

cardCount: {
official: 0
},

boosters: {
vol1: {
name : {
Expand Down
4 changes: 0 additions & 4 deletions data/Scarlet & Violet/SVP Black Star Promos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ const set: Set = {

serie: serie,

cardCount: {
official: 0
},

releaseDate: "2023-03-31",

abbreviations: {
Expand Down
22 changes: 22 additions & 0 deletions meta/definitions/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,28 @@ export interface Card extends CardResume {
*/
boosters?: Array<Booster>

/**
* The card set number at the bottom left / right
*/
set_number: {
/**
* The full text of the card number
*/
text: string
/**
* the first part of the no. (if there is no `/` it will include everything)
*/
nominator: string
/**
* a parseable area as a number (ex: 065 = 65, GG55 = 55)
*/
numeric: number
/**
* The second part of the no (skipped if there is no `/`)
*/
denominator?: string
}

updated: string
}

Expand Down
7 changes: 7 additions & 0 deletions server/compiler/utils/cardUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ export async function cardToCardSingle(localId: string, card: Card, lang: Suppor
})) : undefined,
updated: await getCardLastEdit(localId, card, lang),

set_number: {
text: card.set.cardCount?.official && card.set.cardCount.official > 0 ? `${localId}/${card.set.cardCount.official}` : localId,
nominator: localId.toString(),
numeric: /^\d+$/.test(localId) ? parseInt(localId) : /^\w+?(\d+)$/.test(localId) ? parseInt(RegExp.$1) : undefined,
denominator: card.set.cardCount?.official && card.set.cardCount.official > 0 ? card.set.cardCount.official : undefined
},

thirdParty: card.thirdParty
}
}
Expand Down
8 changes: 4 additions & 4 deletions server/compiler/utils/setUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export async function setToSetSimple(set: Set, lang: SupportedLanguages): Promis
const pics = await getSetPictures(set, lang)
return {
cardCount: {
official: set.cardCount.official,
total: Math.max(set.cardCount.official, cards.length)
official: set.cardCount?.official ?? 0, // keep at zero to not break clients
total: Math.max(set.cardCount?.official ?? 0, cards.length)
},
id: set.id,
logo: pics[0],
Expand Down Expand Up @@ -106,9 +106,9 @@ export async function setToSetSingle(set: Set, lang: SupportedLanguages): Promis
firstEd: cards.reduce((count, card) => count + getVariantCountForType(card[1],"firstEdition"), 0),
holo: cards.reduce((count, card) => count + getVariantCountForType(card[1],"holo"), 0),
normal: cards.reduce((count, card) => count + getVariantCountForType(card[1],"normal"), 0),
official: set.cardCount.official,
official: set.cardCount?.official ?? 0, // keep at zero to not break clients
reverse: cards.reduce((count, card) => count + getVariantCountForType(card[1],"reverse"), 0),
total: Math.max(set.cardCount.official, cards.length)
total: Math.max(set.cardCount?.official ?? 0, cards.length)
},
cards: await Promise.all(cards.map(([id, card]) => cardToCardSimple(id, card, lang))),
id: set.id,
Expand Down
Loading