Added chapters and shoot location. Added In The Crack.
This commit is contained in:
@@ -4,6 +4,10 @@ const knex = require('../knex');
|
||||
const chunk = require('./chunk');
|
||||
|
||||
async function bulkUpsert(table, items, conflict, update = true, chunkSize) {
|
||||
if (items.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const updated = (conflict === false && ':query ON CONFLICT DO NOTHING RETURNING *;')
|
||||
|| (conflict && update && `
|
||||
:query ON CONFLICT (${conflict})
|
||||
|
||||
@@ -20,7 +20,15 @@ async function resolvePlace(query) {
|
||||
const rawPlace = item.address;
|
||||
const place = {};
|
||||
|
||||
if (rawPlace.city) place.city = rawPlace.city;
|
||||
if (item.class === 'place' || item.class === 'boundary') {
|
||||
const location = rawPlace[item.type] || rawPlace.city || rawPlace.place;
|
||||
|
||||
if (location) {
|
||||
place.place = location;
|
||||
place.city = rawPlace.city || location;
|
||||
}
|
||||
}
|
||||
|
||||
if (rawPlace.state) place.state = rawPlace.state;
|
||||
if (rawPlace.country_code) place.country = rawPlace.country_code.toUpperCase();
|
||||
if (rawPlace.continent) place.continent = rawPlace.continent;
|
||||
|
||||
Reference in New Issue
Block a user