Compare commits

..

No commits in common. "0e3145a051cb4435dd1b4c2687a932996912e328" and "aa74c1c7210470f5c34fcb09f691d00ba687bf1f" have entirely different histories.

6 changed files with 35 additions and 40 deletions

View File

@ -5,23 +5,23 @@ dayjs.extend(utc);
const dateRanges = {
latest: () => ({
after: '1900-01-01',
before: dayjs.utc().toDate(),
after: '1900-01-01 00:00:00',
before: dayjs.utc().format('YYYY-MM-DD HH:mm:ss'),
orderBy: 'DATE_DESC',
}),
upcoming: () => ({
after: dayjs.utc().toDate(),
before: '2100-01-01',
after: dayjs.utc().format('YYYY-MM-DD HH:mm:ss'),
before: '2100-01-01 00:00:00',
orderBy: 'DATE_ASC',
}),
new: () => ({
after: '1900-01-01 00:00:00',
before: '2100-01-01',
before: '2100-01-01 00:00:00',
orderBy: ['CREATED_AT_DESC', 'DATE_ASC'],
}),
all: () => ({
after: '1900-01-01',
before: '2100-01-01',
after: '1900-01-01 00:00:00',
before: '2100-01-01 00:00:00',
orderBy: 'DATE_DESC',
}),
};

View File

@ -1004,8 +1004,6 @@ exports.up = knex => Promise.resolve()
GROUP BY entities.id;
$$ 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 $$
SELECT releases.*
FROM releases
@ -1017,22 +1015,18 @@ exports.up = knex => Promise.resolve()
tags ON tags.id = releases_tags.tag_id
WHERE releases_actors.actor_id = actor.id
AND CASE
/* match at least one of the selected tags */
WHEN mode = 'any'
AND array_length(selected_tags, 1) > 0
WHEN mode = 'any' AND array_length(selected_tags, 1) > 0
THEN tags.slug = ANY(selected_tags)
ELSE true
END
GROUP BY releases.id
HAVING CASE
/* match all of the selected tags */
WHEN mode = 'all'
AND array_length(selected_tags, 1) > 0
THEN COUNT(
CASE WHEN tags.slug = ANY(selected_tags)
THEN true
END
) = array_length(selected_tags, 1)
WHEN mode = 'all' AND array_length(selected_tags, 1) > 0
THEN COUNT(
CASE WHEN tags.slug = ANY(selected_tags)
THEN true
END
) = array_length(selected_tags, 1)
ELSE true
END;
$$ LANGUAGE SQL STABLE;

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "traxxx",
"version": "1.128.7",
"version": "1.128.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "traxxx",
"version": "1.128.7",
"version": "1.128.5",
"description": "All the latest porn releases in one place",
"main": "src/app.js",
"scripts": {

View File

@ -110,12 +110,6 @@ const studios = [
url: 'https://www.legalporno.com/studios/omar-galanti-productions',
parent: 'legalporno',
},
{
slug: 'marywet',
name: 'Marywet',
url: 'https://www.legalporno.com/studios/marywet',
parent: 'legalporno',
},
{
slug: 'norestfortheass',
name: 'No Rest For The Ass',

View File

@ -186,41 +186,48 @@ function scrapeUpcoming(html, site) {
const scenesElements = $('#coming_soon_carousel').find('.table').toArray();
return scenesElements.map((element) => {
const release = {};
release.entryId = $(element).find('.upcoming_updates_thumb').attr('id').match(/\d+/)[0];
const entryId = $(element).find('.upcoming_updates_thumb').attr('id').match(/\d+/)[0];
const details = $(element).find('.update_details_comingsoon')
.eq(1)
.children()
.remove();
release.title = details
const title = details
.end()
.text()
.trim();
release.actors = details
const actors = details
.text()
.trim()
.split(', ');
release.date = moment
const date = moment
.utc($(element).find('.update_date_comingsoon').text().slice(7), 'MM/DD/YYYY')
.toDate();
const photoElement = $(element).find('a img.thumbs');
const posterPath = photoElement.attr('src');
release.poster = posterPath.match(/^http/) ? posterPath : `${site.url}${posterPath}`;
const poster = posterPath.match(/^http/) ? posterPath : `${site.url}${posterPath}`;
const videoClass = $(element).find('.update_thumbnail div').attr('class');
const videoScript = $(element).find(`script:contains(${videoClass})`).html();
const teaser = videoScript.slice(videoScript.indexOf('https://'), videoScript.indexOf('.mp4') + 4);
if (videoScript) {
release.teaser = videoScript.slice(videoScript.indexOf('https://'), videoScript.indexOf('.mp4') + 4);
}
return release;
return {
url: null,
entryId,
title,
date,
actors,
poster,
teaser: {
src: teaser,
},
rating: null,
site,
};
});
}