Added basic filename copy. Added HTTP helper to q. Fetching all actor release pages from Naughty America. Added various high res network logos.

This commit is contained in:
2020-02-04 00:18:53 +01:00
parent bffa6d2c9e
commit ef602a3a15
42 changed files with 1483 additions and 54 deletions

View File

@@ -60,21 +60,24 @@ function destructConfigNetworks(networks = []) {
}
async function findSiteByUrl(url) {
const { hostname } = new URL(url);
const domain = hostname.replace(/www.|tour./, '');
const { origin, pathname } = new URL(url);
// const domain = hostname.replace(/www.|tour./, '');
const dirUrl = `${origin}${pathname.split('/').slice(0, 2).join('/')}`; // allow for sites on URI directory
const sites = await knex('sites')
const site = await knex('sites')
.leftJoin('networks', 'sites.network_id', 'networks.id')
.select(
'sites.*',
'networks.name as network_name', 'networks.slug as network_slug', 'networks.url as network_url', 'networks.description as network_description', 'networks.parameters as network_parameters',
)
.where('sites.url', 'like', `%${domain}`)
.orWhere('sites.url', 'like', url)
.orWhere('sites.url', url);
.where('sites.url', url)
.orWhere('sites.url', origin)
.orWhere('sites.url', dirUrl)
// .orWhere('sites.url', 'like', `%${domain}`)
.first();
if (sites.length > 0) {
const curatedSite = curateSite(sites[0], true);
if (site) {
const curatedSite = curateSite(site, true);
return curatedSite;
}