Add possibility to search a card with name in all languages at the same time - #1181
Add possibility to search a card with name in all languages at the same time#1181kvacquier wants to merge 3 commits into
Conversation
|
Im not 100% sure this is an endpoint we would likly want, as it kind of breaks the search logic i.e the soultion i think is in another pr that i have open that links each card and returns all the endpoints for the differnt langagues of the same card. this is possibly also a candiate for v3 of the graphql endpoint to allow you to filter by multiple langs |
* feat: Add Trainer card legality cache and optimize compilation order - Add Trainer card cache to share legality status between cards with the same name - Process cards from newest to oldest sets during compilation (for cache) - Process Trainer cards sequentially, other cards in parallel for performance - Sort final output by release date (oldest first) to maintain original order - Add character name descriptions to Trainer cards (e.g., "Boss's Orders (Giovanni)") This ensures that if a newer Trainer card with the same name is legal, older versions of that Trainer card will also be marked as legal, which aligns with how Trainer cards work in the Pokémon TCG where same-name Trainers share legality. * Cleaning up for card leality post compilation / pre-writting
🃏 10 Cards ChangedDetails: 10 modified Professor's Research (Professor Oak) (cel25-23) (found using en)File: [data/Sword & Shield/Celebrations/23.ts](https://github.com/tcgdex/cards-database/blob/81d0bb571ef71480cc3802e0650f42a51cfcbaaa/data/Sword & Shield/Celebrations/23.ts) Professor's Research (Professor Oak) (cel25-24) (found using en)File: [data/Sword & Shield/Celebrations/24.ts](https://github.com/tcgdex/cards-database/blob/81d0bb571ef71480cc3802e0650f42a51cfcbaaa/data/Sword & Shield/Celebrations/24.ts) Boss's Orders (Giovanni) (swsh2-154) (found using en)File: [data/Sword & Shield/Rebel Clash/154.ts](https://github.com/tcgdex/cards-database/blob/81d0bb571ef71480cc3802e0650f42a51cfcbaaa/data/Sword & Shield/Rebel Clash/154.ts) Boss's Orders (Giovanni) (swsh2-189) (found using en)File: [data/Sword & Shield/Rebel Clash/189.ts](https://github.com/tcgdex/cards-database/blob/81d0bb571ef71480cc3802e0650f42a51cfcbaaa/data/Sword & Shield/Rebel Clash/189.ts) Boss's Orders (Giovanni) (swsh2-200) (found using en)File: [data/Sword & Shield/Rebel Clash/200.ts](https://github.com/tcgdex/cards-database/blob/81d0bb571ef71480cc3802e0650f42a51cfcbaaa/data/Sword & Shield/Rebel Clash/200.ts) Boss's Orders (Lysandre) (swsh4.5-58) (found using en)File: [data/Sword & Shield/Shining Fates/58.ts](https://github.com/tcgdex/cards-database/blob/81d0bb571ef71480cc3802e0650f42a51cfcbaaa/data/Sword & Shield/Shining Fates/58.ts) Professor's Research (Professor Juniper) (swsh4.5-60) (found using en)File: [data/Sword & Shield/Shining Fates/60.ts](https://github.com/tcgdex/cards-database/blob/81d0bb571ef71480cc3802e0650f42a51cfcbaaa/data/Sword & Shield/Shining Fates/60.ts) Professor's Research (Professor Magnolia) (swsh1-178) (found using en)File: [data/Sword & Shield/Sword & Shield/178.ts](https://github.com/tcgdex/cards-database/blob/81d0bb571ef71480cc3802e0650f42a51cfcbaaa/data/Sword & Shield/Sword & Shield/178.ts) Professor's Research (Professor Magnolia) (swsh1-201) (found using en)File: [data/Sword & Shield/Sword & Shield/201.ts](https://github.com/tcgdex/cards-database/blob/81d0bb571ef71480cc3802e0650f42a51cfcbaaa/data/Sword & Shield/Sword & Shield/201.ts) Professor's Research (Professor Magnolia) (swsh1-209) (found using en)File: [data/Sword & Shield/Sword & Shield/209.ts](https://github.com/tcgdex/cards-database/blob/81d0bb571ef71480cc3802e0650f42a51cfcbaaa/data/Sword & Shield/Sword & Shield/209.ts) |
|
I recommend you make your own secondary search layer on top that which tailor to your needs. This is what I have personally done. |
























































































































Changes
anyNamequery parameter to theGET /v2/{lang}/cardsendpointDetails
The existing
namefilter only searches card names in the requested language. This makes it impossible to find a card if you only know its name in another language (e.g. searchingname=Dracaufeuon/v2/en/cardsreturns nothing, even though Charizard exists).The new
anyNameparameter searches across all 18 language card lists and returns the matching cards in the requested language:It supports the same operator prefixes as other filters (
like:,eq:,not:,neq:, etc.) and can be combined with any other query parameter (set,rarity,hp, etc.).Note: since this repository is card data only, you may want to open the PR against the server repo instead if that's tracked separately. Let me know.