Added fixed actor age. Added male profiles to Littlr Caprice Dreams scraper. Added various tag photos.

This commit is contained in:
DebaucheryLibrarian
2020-11-29 03:59:47 +01:00
parent 71c884fe48
commit 9a61d2305c
71 changed files with 123 additions and 33 deletions

View File

@@ -1,5 +1,6 @@
'use strict';
const knex = require('../knex');
const logger = require('../logger')(__filename);
const http = require('./http');
@@ -8,6 +9,20 @@ async function resolvePlace(query) {
return null;
}
// query is a nationality, lookup would get weird results (British resolves to British, Northern Ireland)
const country = await knex('countries')
.where('nationality', 'ilike', `%${query}%`)
.orWhere('alpha3', 'ilike', `%${query}%`)
.orWhere('alpha2', 'ilike', `%${query}%`)
.orderBy('priority', 'desc')
.first();
if (country) {
return {
country: country.alpha2,
};
}
try {
// https://operations.osmfoundation.org/policies/nominatim/
const res = await http.get(`https://nominatim.openstreetmap.org/search/${encodeURI(query)}?format=json&accept-language=en&addressdetails=1`, {