Comments (10)
It's probably because they're never really sorted in a particular order....
from warframe-drop-data.
HM, I was more thinking in the lines of giving everything an _id, but sorting might actually be a good idea 🤔
from warframe-drop-data.
The referenced PR adds an "_id" field and fixes the issue, and it would fix the issue if merged, though instead of using the implementation I suggested in the PR might not be perfect as the conversation in the PR shows. 😄
A live preview of this: https://senexis.github.io/warframe-drop-data/diff.html, though due to the newly added "_id" field it all shows as new items.
from warframe-drop-data.
right, @atomicptr doing both.... give an id, sort by ID
from warframe-drop-data.
There's no need to sort the array as long as it has IDs. Sorting it doesn't add anything because all the transients already have a unique ID at that point and is good enough.
from warframe-drop-data.
right, but if the diff is comparing plain text and not id to id, then that would still be needed...
from warframe-drop-data.
It's not. It seemingly comparing to text (it doesn't; it's the order of the array) is only being done in the case when the ID is missing, so adding an ID to the transients is really good enough.
Edit: Turns out the entire thing is being sorted already anyway.
function sortModName(a, b) {
if (a.modName) { return a.modName.localeCompare(b.modName) }
else if (a._id) { return a._id.localeCompare(b._id) }
}
function sortEnemyName(a, b) {
if (a.enemyName) { return a.enemyName.localeCompare(b.enemyName) }
else if (a._id) { return a._id.localeCompare(b._id) }
}
function sortItemName(a, b) {
if (a.itemName) { return a.itemName.localeCompare(b.itemName) }
else if (a._id) { return a._id.localeCompare(b._id) }
}
from warframe-drop-data.
@Senexis your diff page actually shows the one thing that bothers me about this, instead of seeing hey shit changed for this thing you just see "THIS GOT REMOVED", "THIS GOT ADDED". :D
from warframe-drop-data.
Yep, which is why the PR exists, to attempt to fix it. :-)
The only reason this is happening is because the transients never had an "_id" field.
from warframe-drop-data.
Fixed with #17
from warframe-drop-data.
Related Issues (20)
- Should we change the format? HOT 3
- incomplete information (parsing error) HOT 3
- Relic Parsing Fails for relics numbered above 9
- Out of Date Documentation
- Update broke parser again HOT 1
- Move build process to Travis HOT 3
- Add Sigils
- Dropdata outdated HOT 8
- Searches require <b> tag when including mission type
- Neo Z4 Relic contains drop data for all Requiem Relics HOT 1
- Add Necramech parts
- Add bounty rewards for Deimos/Necralisk HOT 1
- Add additional search methods: exact, regex HOT 1
- enemyModTables.json enemyModDropChance HOT 1
- enemyModTables.json ememyModDropChance (property dup) HOT 1
- enemyBlueprintTables.json wrong property `mods` HOT 1
- enemyBlueprintTables.json sketchy *DropChance properties HOT 1
- Some drop data missing for RJ HOT 2
- Request all drop locations for a specific item (API) HOT 2
- Question: How to know which items are vaulted? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from warframe-drop-data.