alexloney / reddit_marvel_snap_card_bot

u/MarvelSnapCardBot2 on Reddit
MIT License
2 stars 0 forks source link

Fix Base/Summon Order #16

Closed alexloney closed 6 months ago

alexloney commented 6 months ago

It looks like the data source that is being used (marvelsnap.pro) is not being consistent on when is_Token is or isn't being set. So it resulted in some instances where a card would be linked together, but would not indicate which is the token and which is the base card, causing output that looked like the summon summoned the base card.

In addition to the above, I found some other inconsistencies such as Widow's Bite did not list as connected to Black Widow, causing it to appear as a standalone card rather thing pulling in that it was summoned.

Instead of continuing with a hardcoded list of corrected issues, I've created a patches.py which contains a configuration file for all patches that I'm applying to the data source after reading it. This is to correct any of these inconsistencies that I'm seeing. Now, patching a data source like this isn't ideal, but I'm uncertain how to resolve this without doing something like that. So I've read over the data source and tried to find all instances that required a similar patch and apply them here.

One additional comment, I noticed that Spider-Man links to Uncle Ben, listing Uncle Ben as a token of the card. There are two strange things with this. Firstly, I'd expect the opposite direction for a card/token. Secondly, Uncle Ben hasn't been released. So instead of outputting like that, I'm just removing Uncle Ben from the results.

One thought here, instead of removing Uncle Ben, we could have a data patch that unlinks Spider-Man from it, to still allow it to be searched? I think it's a bit less important at this point, so I'll just keep Uncle Ben removed for the moment.