forked from DebaucheryLibrarian/traxxx
Removed release_date selection, not working as desired. Removed site and tag fetching from Kink scraper.
This commit is contained in:
parent
71cb85c3e1
commit
2697aaa0af
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue