Closed stravinskij closed 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...
NOTE: JSON is actually okay... I think
I can confirm I too see the same errors in the csv export from the Plugin.
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.
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.
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.
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