Fix bugs in platform data assignment
parent
a769cf04fa
commit
b2d49ffef4
|
@ -97,11 +97,7 @@ function _parseLatestPlatformHTML(html) {
|
||||||
*/
|
*/
|
||||||
function _assignLatestPlatformData(data) {
|
function _assignLatestPlatformData(data) {
|
||||||
// Local variables
|
// Local variables
|
||||||
const propertiesMap = {
|
const scrapedData = {};
|
||||||
"Engine": shared.engines,
|
|
||||||
"Status": shared.statuses,
|
|
||||||
"Other": shared.others,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Extract and parse the data
|
// Extract and parse the data
|
||||||
const prefixes = data.prefixes.games.map(e => {
|
const prefixes = data.prefixes.games.map(e => {
|
||||||
|
@ -118,10 +114,13 @@ function _assignLatestPlatformData(data) {
|
||||||
for (const e of p.data) dict[parseInt(e.id)] = e.name.replace("'", "'");
|
for (const e of p.data) dict[parseInt(e.id)] = e.name.replace("'", "'");
|
||||||
|
|
||||||
// Save the property
|
// Save the property
|
||||||
propertiesMap[p] = dict;
|
scrapedData[p.element] = dict;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse the tags
|
// Save the values
|
||||||
|
shared.engines = scrapedData["Engines"];
|
||||||
|
shared.statuses = scrapedData["Status"];
|
||||||
|
shared.others = scrapedData["Other"];
|
||||||
shared.tags = data.tags;
|
shared.tags = data.tags;
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
Loading…
Reference in New Issue