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

Upgrade [or others?] with ' - ' in their name don't parse correctly #23

Closed
paulpv opened this issue Jul 3, 2018 · 7 comments
Closed

Comments

@paulpv
Copy link

paulpv commented Jul 3, 2018

Upgrades that have a ' - ' in their ship name don't parse correctly:
Examples:
"SHIP UPGRADES - CYCLONE TO TUMBRIL - NOVA TANK UPGRADE"
"SHIP UPGRADES - ORIGIN X1 - VELOCITY TO ORIGIN X1 - FORCE UPGRADE"
"SHIP UPGRADES - ORIGIN X1 TO ORIGIN X1 - FORCE UPGRADE"

The problem is a combination of var titleParts = pledgeName.split(/\s-\s/) and how titleParts[index > 0] are used.

I'm working on a fix for this, but if you have a quick fix idea feel free to impl it yourself.

@paulpv paulpv changed the title Items with '-' in the ship name don't parse correctly Ships with '-' in their name don't parse correctly Jul 3, 2018
@paulpv paulpv changed the title Ships with '-' in their name don't parse correctly Ships with ' - ' in their name don't parse correctly Jul 3, 2018
@paulpv
Copy link
Author

paulpv commented Jul 3, 2018

First pass at fix:
paulpv@8704508

@paulpv
Copy link
Author

paulpv commented Jul 3, 2018

It's a bit buggy; don't take the code yet.

@peter-dolkens
Copy link
Member

What are you seeing with the Nova?

image

Looks ok to me? I don't have an upgraded X1 to test with tonight...

@paulpv
Copy link
Author

paulpv commented Jul 3, 2018

Improved w/ paulpv@d5aa032

In general the whole var titleParts = pledgeName.split(/\s-\s/) seems fragile, but I haven't bothered to come up w/ anything better so I'm sticking to that until I do.

@paulpv
Copy link
Author

paulpv commented Jul 3, 2018

Perhaps it isn't with "Ships", but "Upgrades".
It happened with:
SHIP UPGRADES - CYCLONE TO TUMBRIL - NOVA TANK UPGRADE
came out as UPGRADE - CYCLONE TO TUMBRIL
SHIP UPGRADES - ORIGIN X1 - VELOCITY TO ORIGIN X1 - FORCE UPGRADE
came out as UPGRADE - ORIGIN X1 TO ORIGIN X1
SHIP UPGRADES - ORIGIN X1 TO ORIGIN X1 - FORCE UPGRADE
came out as UPGRADE - ORIGIN X1 TO ORIGIN X1

I have edited my original comment to state this.

@paulpv paulpv changed the title Ships with ' - ' in their name don't parse correctly Upgrade [or others?] with ' - ' in their name don't parse correctly Jul 3, 2018
@peter-dolkens
Copy link
Member

peter-dolkens commented Jul 3, 2018

Ah yes, I think I noticed something about that a while back and forgot about it (don't often check CCUs)

Excellent. Will take a look next chance I get.

And yes, the whole thing is rather fragile - that's why there's a big "correction" section in the Processing file that attempts to standardize CIGs naming to some extent. The splits and regexes only cover 90% of scenarios - the other 10% we have to fix manually :'(

And that's before we get to the differences between "packages", and "add-ons".

@peter-dolkens peter-dolkens pinned this issue Mar 10, 2021
@peter-dolkens
Copy link
Member

I suspect this will be resolved in v2 that was just released @paulpv - it's quite a refactor though, but it's designed to standardize the ship codes / manufacturer codes to match up with docs.starcitizen.fans so Erkul and FleetViewer can share/import the data HangarXPLOR exports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants