From 2697aaa0afc67e4b62903ea8b5e84e0afcc4d7e3 Mon Sep 17 00:00:00 2001 From: Niels Simenon Date: Thu, 5 Dec 2019 01:33:57 +0100 Subject: [PATCH] Removed release_date selection, not working as desired. Removed site and tag fetching from Kink scraper. --- src/releases.js | 2 -- src/scrapers/kink.js | 18 ++++-------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/releases.js b/src/releases.js index dd9e6706..ea977533 100644 --- a/src/releases.js +++ b/src/releases.js @@ -165,9 +165,7 @@ function commonQuery(queryBuilder, { .andWhereRaw('tags_associated.release_id = releases.id'); }) .andWhere('date', '>', after) - .orWhere('releases.created_at', '>', after) .andWhere('date', '<=', before) - .orWhere('releases.created_at', '<=', before) .orderBy([{ column: 'date', order: 'desc' }, { column: 'created_at', order: 'desc' }]) .limit(limit); } diff --git a/src/scrapers/kink.js b/src/scrapers/kink.js index b6d1274c..5603322e 100644 --- a/src/scrapers/kink.js +++ b/src/scrapers/kink.js @@ -4,9 +4,6 @@ const bhttp = require('bhttp'); const cheerio = require('cheerio'); const moment = require('moment'); -const { fetchSites } = require('../sites'); -const { matchTags } = require('../tags'); - function scrapeLatest(html, site) { const $ = cheerio.load(html, { normalizeWhitespace: true }); const sceneElements = $('.shoot-list .shoot').toArray(); @@ -73,17 +70,9 @@ async function scrapeScene(html, url, shootId, ratingRes, site) { const siteName = $('.shoot-logo a').attr('href').split('/')[2]; const siteSlug = siteName.replace(/\s+/g, '').toLowerCase(); - const rawTags = $('.tag-list > a[href*="/tag"]').map((tagIndex, tagElement) => $(tagElement).text()).toArray(); - const [[channelSite], tags] = await Promise.all([ - site.isFallback - ? fetchSites({ - slug: siteSlug, - name: siteName, - }) - : [site], - matchTags(rawTags), - ]); + const tags = $('.tag-list > a[href*="/tag"]').map((tagIndex, tagElement) => $(tagElement).text()).toArray(); + const channel = siteSlug; return { url, @@ -103,7 +92,8 @@ async function scrapeScene(html, url, shootId, ratingRes, site) { stars, }, tags, - site: channelSite || site, + site, + channel, }; }