davidchambers / tutor

JavaScript interface for the Gatherer card database
https://gatherer.wizards.com/
Do What The F*ck You Want To Public License
149 stars 18 forks source link

Include multiverse ID in cards in set listing #25

Closed jbhannah closed 11 years ago

jbhannah commented 12 years ago

In GET /set/:name(/:page) it might be useful to know the multiverse ID of a card's specific version that is included in that set, without having to parse that card's versions. This is as opposed to requesting a card by its multiverse ID, in which case the multiverse ID is already known; or requesting a card by its name, without caring about a specific version and being able to see all of the versions with their multiverse IDs.

davidchambers commented 12 years ago

What's the value of multiverse_id beyond determining gatherer_url and image_url (which are included in the response)?

jbhannah commented 12 years ago

One example would be using Tutor to seed a card database, and wanting to associate a specific version of a card with the set it belongs to. Another would be a collection management application that uses Tutor directly, and tracking quantities of card versions specific to a set from a page of cards in that set as returned by GET /set/:name(/:page).

davidchambers commented 12 years ago

Tutor needn't do this, necessarily, since extracting multiverse_id from gatherer_url is relatively easy:

multiverse_id = +/multiverseid=(\d+)/.exec(card.gatherer_url)[1]

In order for this pull request to be accepted…

You may decide that it's less work to extract this information in your application than to make these changes to Tutor. ;)

nicknovitski commented 12 years ago

I was just today starting a branch about database support, so I can definitely see the use of reusing Gatherer's unique identifiers, but I agree with all of David's points: update the tests, and keep the /card and /set responses consistently structured.

jbhannah commented 12 years ago

Challenge accepted. Give me a few days, my fall semester starts this week so I'm a bit swamped at the moment.

davidchambers commented 11 years ago

The repository's layout has changed beyond recognition since this pull request was created. I'm still open to such a change, but it'll need a new pull request.