forked from DebaucheryLibrarian/traxxx
Added fixed actor age. Added male profiles to Littlr Caprice Dreams scraper. Added various tag photos.
This commit is contained in:
@@ -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`, {
|
||||
|
||||
Reference in New Issue
Block a user