dolkensp / HangarXPLOR

HangarXPLOR is a chrome extension that upgrades the UI/UX of the Star Citizen hangar page
https://robertsspaceindustries.com/
MIT License
57 stars 25 forks source link

CSV and JSON export show undefined for most columns #82

Closed stravinskij closed 3 years ago

stravinskij commented 3 years ago

Wait for plugin to finish loading on hangar page and click download csv see example output below

over 456 ships not sure if thats just too much for it. please let me know if you need any more info

see you in the verse - Sarg3v3

Manufacturer, Ship, Lti, Warbond, ID, Pledge, Cost, Date "undefined","100i",false,false,,"undefined","undefined","2021-02-21" "undefined","100i",false,false,,"undefined","undefined","2021-02-19" "undefined","100i",false,true,,"undefined","undefined","2020-10-11" "undefined","125a",false,false,,"undefined","undefined","2021-02-21" "undefined","125a",false,false,,"undefined","undefined","2021-02-19" "undefined","125a",false,true,,"undefined","undefined","2020-10-11" "undefined","135c",false,false,,"undefined","undefined","2021-02-21" "undefined","135c",false,false,,"undefined","undefined","2021-02-19" "undefined","135c",true,false,,"undefined","undefined","2020-02-23" "undefined","135c",true,false,,"undefined","undefined","2020-02-03" "undefined","300i",false,false,,"undefined","undefined","2020-01-30" "undefined","300i",true,true,,"undefined","undefined","2020-01-04" "undefined","300i",true,false,,"undefined","undefined","2017-07-27" "undefined","315p",false,false,,"undefined","undefined","2021-01-22" "undefined","315p",false,false,,"undefined","undefined","2020-01-30" "undefined","315p",true,false,,"undefined","undefined","2019-12-25" "undefined","315p",true,false,,"undefined","undefined","2017-07-27" "undefined","325a Fighter",false,false,,"undefined","undefined","2021-03-05" "undefined","325a Fighter",false,false,,"undefined","undefined","2020-01-30" "undefined","325a Fighter",true,true,,"undefined","undefined","2020-01-04" "undefined","325a Fighter",true,false,,"undefined","undefined","2017-07-27" "undefined","350r",true,false,,"undefined","undefined","2020-02-23" "undefined","350r",true,false,,"undefined","undefined","2017-07-27" "undefined","600i",true,false,,"undefined","undefined","2020-02-23"

stravinskij commented 3 years ago

in src/web_resources/HangarXPLOR.Download.js

starting at line 89 data is mapped to

        var $ship = this;
        var ship = {};
        ship.name = $('.title', $ship).text().trim();
        ship.name = ship.name.replace(/^\s*(?:Aegis|Anvil|Aopoa|Argo|Banu|CNOU|Crusader|Drake|Esperia Vanduul|Esperia|Kruger|MISC|Origin|RSI|Tumbril|Captured Vanduul|Vanduul|Xi'an)[^a-z0-9]+/gi, '');
        ship.name = _shipNameCorrection[ship.name] || ship.name;
        ship.manufacturer_code = $('.liner span', $ship).text();
        ship.manufacturer_name = _manufacturerNameByCode[ship.manufacturer_code] || ship.manufacturer_code;
        ship.manufacturer_code = _manufacturerCodeByName[ship.manufacturer_name] || ship.manufacturer_code;
        ship.ship_code = ship.manufacturer_code + '_' + ship.name.replace(/Aurora [A-Z]+/gi, 'Aurora').replace(/ - .*/gi, '').replace(/-/gi, '').replace(/ /gi, '_');
        ship.ship_code = _shipCodeCorrection[ship.ship_code] || ship.ship_code;
        ship.ship_name = $('.custom-name-text', $ship).text() || ship.name;
        ship.ship_serial = $('.liner:contains(Serial)',  $ship).text().replace(/Serial: /, '') || null;
        ship.pledge_id = pledge.id;
        ship.pledge_name = pledge.name;
        ship.pledge_date = new Date(Date.parse(pledge.date)).toISOString().substr(0, 10);
        ship.pledge_cost = pledge.cost;
        ship.lti = pledge.lti;
        ship.warbond = pledge.warbond;

then on line 130

buffer = buffer + HangarXPLOR.GetShipList($target).map(function(ship) { return [ '"' + ship.manufacturer + '"', '"' + ship.name + '"', ship.lti, ship.warbond, ship.package_id, '"' + ship.pledge + '"', '"' + ship.cost + '"', '"' + ship.pledge_date + '"' ].join(',')}).join('\n')

the defined properties of local variable ship is the same in both map callback functions...

stravinskij commented 3 years ago

NOTE: JSON is actually okay... I think

Da-Geek commented 3 years ago

I can confirm I too see the same errors in the csv export from the Plugin.

peter-dolkens commented 3 years ago

Have you purchased the new Scorpius or Roc DS by any chance?

Edit: just saw this was an older report that I must have missed. I'll look into it this weekend.

stravinskij commented 3 years ago

I have after submitting this. Need me to test something? Noticed my mpuvs were missing from csv export yesterday as well haven't looked into it yet.

JP Stravinski


From: Peter Dolkens @.> Sent: Saturday, May 22, 2021 9:48:05 AM To: dolkensp/HangarXPLOR @.> Cc: JP Stravinski @.>; Author @.> Subject: Re: [dolkensp/HangarXPLOR] CSV and JSON export show undefined for most columns (#82)

Have you purchased the new Scorpius or Roc DS by any chance?

Peter Dolkens

On 20 Apr 2021, at 03:29, JP Stravinski @.***> wrote:

 in src/web_resources/HangarXPLOR.Download.js

starting at line 89 data is mapped to

var $ship = this; var ship = {}; ship.name = $('.title', $ship).text().trim(); ship.name = ship.name.replace(/^\s(?:Aegis|Anvil|Aopoa|Argo|Banu|CNOU|Crusader|Drake|Esperia Vanduul|Esperia|Kruger|MISC|Origin|RSI|Tumbril|Captured Vanduul|Vanduul|Xi'an)[^a-z0-9]+/gi, ''); ship.name = _shipNameCorrection[ship.name] || ship.name; ship.manufacturer_code = $('.liner span', $ship).text(); ship.manufacturer_name = _manufacturerNameByCode[ship.manufacturer_code] || ship.manufacturer_code; ship.manufacturer_code = _manufacturerCodeByName[ship.manufacturer_name] || ship.manufacturer_code; ship.ship_code = ship.manufacturercode + '' + ship.name.replace(/Aurora [A-Z]+/gi, 'Aurora').replace(/ - ./gi, '').replace(/-/gi, '').replace(/ /gi, '_'); ship.ship_code = _shipCodeCorrection[ship.ship_code] || ship.ship_code; ship.ship_name = $('.custom-name-text', $ship).text() || ship.name; ship.ship_serial = $('.liner:contains(Serial)', $ship).text().replace(/Serial: /, '') || null; ship.pledge_id = pledge.id; ship.pledge_name = pledge.name; ship.pledge_date = new Date(Date.parse(pledge.date)).toISOString().substr(0, 10); ship.pledge_cost = pledge.cost; ship.lti = pledge.lti; ship.warbond = pledge.warbond; then on line 130

buffer = buffer + HangarXPLOR.GetShipList($target).map(function(ship) { return [ '"' + ship.manufacturer + '"', '"' + ship.name + '"', ship.lti, ship.warbond, ship.package_id, '"' + ship.pledge + '"', '"' + ship.cost + '"', '"' + ship.pledge_date + '"' ].join(',')}).join('\n') the defined properties of local variable ship is the same in both map callback functions...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/dolkensp/HangarXPLOR/issues/82#issuecomment-846434293, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA35F7A546IFAF7IX2TUBQ3TO7N4LANCNFSM43CQBNPA.

peter-dolkens commented 3 years ago

No I think it's good now, looks like there's actually a PR open for this already. I'll test it when I'm back at a computer and merge.

I was in the middle of a more major rewrite, but this will fix things in the meantime.