AlphaKretin / ygo-data

A Node module to parse YGOPro card databases and other files into useful card data
GNU General Public License v3.0
11 stars 0 forks source link

Issue with database loading #3

Closed AlphaKretin closed 5 years ago

AlphaKretin commented 5 years ago

The database loading system is different from the old Bastion. Instead of keeping data/text pairs separated by language, each card only has one data set and only the text is split by language. This is more convenient and logical in just about every way, but its implementation has some issues.

Which of the various options it takes is not well-defined. I need to make sure it takes the most recent version of a card's data but from the first language loaded. This should ensure it gets the latest data from Percy's English database.

An example of a card affected by this issue is Underclock Taker.
In old Bastion:
old bastion underclock taker
In the rework:
rework bastion underclock taker
Note the status.

AlphaKretin commented 5 years ago

Transferred from bastion-bot as database loading is the domain of ygo-data

AlphaKretin commented 5 years ago

Potential solution: the design of the repositories Bastion relies on is such that a card should appear in no more than two databases - cards.cdb, which is static, and one from the live update system. Hence, overwriting with the newest loaded databases that isn't named cards.cdb should ensure the latest update is loaded.

AlphaKretin commented 5 years ago

Despite the result of the integration test, it still appears incorrect in Bastion proper. This will need more work after all.

AlphaKretin commented 5 years ago

No, it is fixed, npm install just didn't actually update it on Bastion. Thanks, npm!

AlphaKretin commented 5 years ago

Percy anime cards such can still have loading issues as their main database is not called cards.cdb. I'm hesitant, but not entirely unwilling, to just hard code that special case, but I'll give it a bit of thought first.

AlphaKretin commented 5 years ago

I may change the solution from first loading prioritising databases with certain names to first loading databases that are on the hard drive rather than loaded live, but this would be an involved change and not account for every use case.