Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

full name field for cards with 2+ faces #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions scryfall-google-sheets.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// this function is available here:
// https://github.com/scryfall/google-sheets/blob/main/scryfall-google-sheets.js
// and was last updated on 2021-01-08 (probably)
// and was last updated on 2022-10-18 (probably)

const MAX_RESULTS_ = 700; // a safe max due to Google Sheets timeout system

Expand Down Expand Up @@ -72,9 +72,9 @@ const SCRYFALL = (query, fields = "name", num_results = 150,
cards.splice(0, num_results).forEach(card => {
let row = [];

// there is probably a better way to handle card faces, but this is
// probably sufficient for the vast majority of use cases
// use front face of the card, but keeping the full name
if ("card_faces" in card) {
card["card_faces"][0]["name"] = card["name"];
Object.assign(card, card["card_faces"][0]);
}

Expand Down