Removed release_date selection, not working as desired. Removed site and tag fetching from Kink scraper.

This commit is contained in:
ThePendulum 2019-12-05 01:33:57 +01:00
parent 71cb85c3e1
commit 2697aaa0af
2 changed files with 4 additions and 16 deletions

View File

@ -165,9 +165,7 @@ function commonQuery(queryBuilder, {
.andWhereRaw('tags_associated.release_id = releases.id'); .andWhereRaw('tags_associated.release_id = releases.id');
}) })
.andWhere('date', '>', after) .andWhere('date', '>', after)
.orWhere('releases.created_at', '>', after)
.andWhere('date', '<=', before) .andWhere('date', '<=', before)
.orWhere('releases.created_at', '<=', before)
.orderBy([{ column: 'date', order: 'desc' }, { column: 'created_at', order: 'desc' }]) .orderBy([{ column: 'date', order: 'desc' }, { column: 'created_at', order: 'desc' }])
.limit(limit); .limit(limit);
} }

View File

@ -4,9 +4,6 @@ const bhttp = require('bhttp');
const cheerio = require('cheerio'); const cheerio = require('cheerio');
const moment = require('moment'); const moment = require('moment');
const { fetchSites } = require('../sites');
const { matchTags } = require('../tags');
function scrapeLatest(html, site) { function scrapeLatest(html, site) {
const $ = cheerio.load(html, { normalizeWhitespace: true }); const $ = cheerio.load(html, { normalizeWhitespace: true });
const sceneElements = $('.shoot-list .shoot').toArray(); 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 siteName = $('.shoot-logo a').attr('href').split('/')[2];
const siteSlug = siteName.replace(/\s+/g, '').toLowerCase(); 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([ const tags = $('.tag-list > a[href*="/tag"]').map((tagIndex, tagElement) => $(tagElement).text()).toArray();
site.isFallback const channel = siteSlug;
? fetchSites({
slug: siteSlug,
name: siteName,
})
: [site],
matchTags(rawTags),
]);
return { return {
url, url,
@ -103,7 +92,8 @@ async function scrapeScene(html, url, shootId, ratingRes, site) {
stars, stars,
}, },
tags, tags,
site: channelSite || site, site,
channel,
}; };
} }