Fix poisoned ground truth data...
This commit is contained in:
parent
6a133de318
commit
b4ac2bed8f
|
@ -90,6 +90,7 @@ function mergePriceHistory(oldItems, items) {
|
||||||
|
|
||||||
const lookup = {};
|
const lookup = {};
|
||||||
for (oldItem of oldItems) {
|
for (oldItem of oldItems) {
|
||||||
|
if (!oldItem.name) continue;
|
||||||
delete oldItem.unavailable;
|
delete oldItem.unavailable;
|
||||||
lookup[oldItem.store + oldItem.id] = oldItem;
|
lookup[oldItem.store + oldItem.id] = oldItem;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ const compression = require("compression");
|
||||||
const i18n = require("./i18n");
|
const i18n = require("./i18n");
|
||||||
|
|
||||||
function copyItemsToSite(dataDir) {
|
function copyItemsToSite(dataDir) {
|
||||||
const items = analysis.readJSON(`${dataDir}/latest-canonical.json.${analysis.FILE_COMPRESSOR}`);
|
const items = analysis.readJSON(`${dataDir}/latest-canonical.json.${analysis.FILE_COMPRESSOR}`).filter((item) => item.name);
|
||||||
analysis.writeJSON(`site/output/data/latest-canonical.json`, items);
|
analysis.writeJSON(`site/output/data/latest-canonical.json`, items);
|
||||||
for (const store of analysis.STORE_KEYS) {
|
for (const store of analysis.STORE_KEYS) {
|
||||||
const storeItems = items.filter((item) => item.store === store);
|
const storeItems = items.filter((item) => item.store === store);
|
||||||
|
|
Loading…
Reference in New Issue