Compare commits
4 Commits
aa74c1c721
...
0e3145a051
Author | SHA1 | Date |
---|---|---|
|
0e3145a051 | |
|
eb6337f6fb | |
|
9499cd0265 | |
|
471f8f2bec |
|
@ -5,23 +5,23 @@ dayjs.extend(utc);
|
||||||
|
|
||||||
const dateRanges = {
|
const dateRanges = {
|
||||||
latest: () => ({
|
latest: () => ({
|
||||||
after: '1900-01-01 00:00:00',
|
after: '1900-01-01',
|
||||||
before: dayjs.utc().format('YYYY-MM-DD HH:mm:ss'),
|
before: dayjs.utc().toDate(),
|
||||||
orderBy: 'DATE_DESC',
|
orderBy: 'DATE_DESC',
|
||||||
}),
|
}),
|
||||||
upcoming: () => ({
|
upcoming: () => ({
|
||||||
after: dayjs.utc().format('YYYY-MM-DD HH:mm:ss'),
|
after: dayjs.utc().toDate(),
|
||||||
before: '2100-01-01 00:00:00',
|
before: '2100-01-01',
|
||||||
orderBy: 'DATE_ASC',
|
orderBy: 'DATE_ASC',
|
||||||
}),
|
}),
|
||||||
new: () => ({
|
new: () => ({
|
||||||
after: '1900-01-01 00:00:00',
|
after: '1900-01-01 00:00:00',
|
||||||
before: '2100-01-01 00:00:00',
|
before: '2100-01-01',
|
||||||
orderBy: ['CREATED_AT_DESC', 'DATE_ASC'],
|
orderBy: ['CREATED_AT_DESC', 'DATE_ASC'],
|
||||||
}),
|
}),
|
||||||
all: () => ({
|
all: () => ({
|
||||||
after: '1900-01-01 00:00:00',
|
after: '1900-01-01',
|
||||||
before: '2100-01-01 00:00:00',
|
before: '2100-01-01',
|
||||||
orderBy: 'DATE_DESC',
|
orderBy: 'DATE_DESC',
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
|
@ -1004,6 +1004,8 @@ exports.up = knex => Promise.resolve()
|
||||||
GROUP BY entities.id;
|
GROUP BY entities.id;
|
||||||
$$ LANGUAGE SQL STABLE;
|
$$ LANGUAGE SQL STABLE;
|
||||||
|
|
||||||
|
/* GraphQL/Postgraphile 'every' applies to the data, will only include scenes for which every assigned tag is selected,
|
||||||
|
instead of what we want; scenes with every selected tag, but possibly also some others */
|
||||||
CREATE FUNCTION actors_scenes(actor actors, selected_tags text[], mode text DEFAULT 'all') RETURNS SETOF releases AS $$
|
CREATE FUNCTION actors_scenes(actor actors, selected_tags text[], mode text DEFAULT 'all') RETURNS SETOF releases AS $$
|
||||||
SELECT releases.*
|
SELECT releases.*
|
||||||
FROM releases
|
FROM releases
|
||||||
|
@ -1015,13 +1017,17 @@ exports.up = knex => Promise.resolve()
|
||||||
tags ON tags.id = releases_tags.tag_id
|
tags ON tags.id = releases_tags.tag_id
|
||||||
WHERE releases_actors.actor_id = actor.id
|
WHERE releases_actors.actor_id = actor.id
|
||||||
AND CASE
|
AND CASE
|
||||||
WHEN mode = 'any' AND array_length(selected_tags, 1) > 0
|
/* match at least one of the selected tags */
|
||||||
|
WHEN mode = 'any'
|
||||||
|
AND array_length(selected_tags, 1) > 0
|
||||||
THEN tags.slug = ANY(selected_tags)
|
THEN tags.slug = ANY(selected_tags)
|
||||||
ELSE true
|
ELSE true
|
||||||
END
|
END
|
||||||
GROUP BY releases.id
|
GROUP BY releases.id
|
||||||
HAVING CASE
|
HAVING CASE
|
||||||
WHEN mode = 'all' AND array_length(selected_tags, 1) > 0
|
/* match all of the selected tags */
|
||||||
|
WHEN mode = 'all'
|
||||||
|
AND array_length(selected_tags, 1) > 0
|
||||||
THEN COUNT(
|
THEN COUNT(
|
||||||
CASE WHEN tags.slug = ANY(selected_tags)
|
CASE WHEN tags.slug = ANY(selected_tags)
|
||||||
THEN true
|
THEN true
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.128.5",
|
"version": "1.128.7",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.128.5",
|
"version": "1.128.7",
|
||||||
"description": "All the latest porn releases in one place",
|
"description": "All the latest porn releases in one place",
|
||||||
"main": "src/app.js",
|
"main": "src/app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -110,6 +110,12 @@ const studios = [
|
||||||
url: 'https://www.legalporno.com/studios/omar-galanti-productions',
|
url: 'https://www.legalporno.com/studios/omar-galanti-productions',
|
||||||
parent: 'legalporno',
|
parent: 'legalporno',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
slug: 'marywet',
|
||||||
|
name: 'Marywet',
|
||||||
|
url: 'https://www.legalporno.com/studios/marywet',
|
||||||
|
parent: 'legalporno',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
slug: 'norestfortheass',
|
slug: 'norestfortheass',
|
||||||
name: 'No Rest For The Ass',
|
name: 'No Rest For The Ass',
|
||||||
|
|
|
@ -186,48 +186,41 @@ function scrapeUpcoming(html, site) {
|
||||||
const scenesElements = $('#coming_soon_carousel').find('.table').toArray();
|
const scenesElements = $('#coming_soon_carousel').find('.table').toArray();
|
||||||
|
|
||||||
return scenesElements.map((element) => {
|
return scenesElements.map((element) => {
|
||||||
const entryId = $(element).find('.upcoming_updates_thumb').attr('id').match(/\d+/)[0];
|
const release = {};
|
||||||
|
|
||||||
|
release.entryId = $(element).find('.upcoming_updates_thumb').attr('id').match(/\d+/)[0];
|
||||||
|
|
||||||
const details = $(element).find('.update_details_comingsoon')
|
const details = $(element).find('.update_details_comingsoon')
|
||||||
.eq(1)
|
.eq(1)
|
||||||
.children()
|
.children()
|
||||||
.remove();
|
.remove();
|
||||||
|
|
||||||
const title = details
|
release.title = details
|
||||||
.end()
|
.end()
|
||||||
.text()
|
.text()
|
||||||
.trim();
|
.trim();
|
||||||
|
|
||||||
const actors = details
|
release.actors = details
|
||||||
.text()
|
.text()
|
||||||
.trim()
|
.trim()
|
||||||
.split(', ');
|
.split(', ');
|
||||||
|
|
||||||
const date = moment
|
release.date = moment
|
||||||
.utc($(element).find('.update_date_comingsoon').text().slice(7), 'MM/DD/YYYY')
|
.utc($(element).find('.update_date_comingsoon').text().slice(7), 'MM/DD/YYYY')
|
||||||
.toDate();
|
.toDate();
|
||||||
|
|
||||||
const photoElement = $(element).find('a img.thumbs');
|
const photoElement = $(element).find('a img.thumbs');
|
||||||
const posterPath = photoElement.attr('src');
|
const posterPath = photoElement.attr('src');
|
||||||
const poster = posterPath.match(/^http/) ? posterPath : `${site.url}${posterPath}`;
|
release.poster = posterPath.match(/^http/) ? posterPath : `${site.url}${posterPath}`;
|
||||||
|
|
||||||
const videoClass = $(element).find('.update_thumbnail div').attr('class');
|
const videoClass = $(element).find('.update_thumbnail div').attr('class');
|
||||||
const videoScript = $(element).find(`script:contains(${videoClass})`).html();
|
const videoScript = $(element).find(`script:contains(${videoClass})`).html();
|
||||||
const teaser = videoScript.slice(videoScript.indexOf('https://'), videoScript.indexOf('.mp4') + 4);
|
|
||||||
|
|
||||||
return {
|
if (videoScript) {
|
||||||
url: null,
|
release.teaser = videoScript.slice(videoScript.indexOf('https://'), videoScript.indexOf('.mp4') + 4);
|
||||||
entryId,
|
}
|
||||||
title,
|
|
||||||
date,
|
return release;
|
||||||
actors,
|
|
||||||
poster,
|
|
||||||
teaser: {
|
|
||||||
src: teaser,
|
|
||||||
},
|
|
||||||
rating: null,
|
|
||||||
site,
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue