Compare commits
3 Commits
a77e13c7de
...
37b92209f0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37b92209f0 | ||
|
|
9754f9e9af | ||
|
|
ccd833665f |
19
migrations/20260203052449_scene_attributes.js
Normal file
19
migrations/20260203052449_scene_attributes.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
exports.up = async (knex) => {
|
||||||
|
await knex.schema.alterTable('releases', (table) => {
|
||||||
|
table.json('attributes');
|
||||||
|
});
|
||||||
|
|
||||||
|
await knex.schema.alterTable('movies', (table) => {
|
||||||
|
table.json('attributes');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.down = async (knex) => {
|
||||||
|
await knex.schema.alterTable('releases', (table) => {
|
||||||
|
table.dropColumn('attributes');
|
||||||
|
});
|
||||||
|
|
||||||
|
await knex.schema.alterTable('movies', (table) => {
|
||||||
|
table.dropColumn('attributes');
|
||||||
|
});
|
||||||
|
};
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.248.20",
|
"version": "1.248.21",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.248.20",
|
"version": "1.248.21",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-s3": "^3.458.0",
|
"@aws-sdk/client-s3": "^3.458.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.248.20",
|
"version": "1.248.21",
|
||||||
"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": {
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ async function scrapeScene(scene, channel, parameters, includeTrailers) {
|
|||||||
const release = {};
|
const release = {};
|
||||||
|
|
||||||
release.entryId = scene.id;
|
release.entryId = scene.id;
|
||||||
|
|
||||||
|
release.attributes = {
|
||||||
|
entryId: scene.itemId,
|
||||||
|
};
|
||||||
|
|
||||||
release.url = `${channel.type === 'network' || channel.parameters?.layout === 'organic' ? channel.url : channel.parent.url}/movies/${release.entryId}`;
|
release.url = `${channel.type === 'network' || channel.parameters?.layout === 'organic' ? channel.url : channel.parent.url}/movies/${release.entryId}`;
|
||||||
|
|
||||||
release.title = scene.title;
|
release.title = scene.title;
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ async function curateReleaseEntry(release, batchId, existingRelease, type = 'sce
|
|||||||
slug,
|
slug,
|
||||||
description: decode(release.description),
|
description: decode(release.description),
|
||||||
comment: release.comment,
|
comment: release.comment,
|
||||||
|
attributes: release.attributes,
|
||||||
photo_count: Number(release.photoCount) || null,
|
photo_count: Number(release.photoCount) || null,
|
||||||
deep: typeof release.deep === 'boolean' ? release.deep : false,
|
deep: typeof release.deep === 'boolean' ? release.deep : false,
|
||||||
deep_url: release.deepUrl,
|
deep_url: release.deepUrl,
|
||||||
@@ -439,10 +440,11 @@ async function storeScenes(releases, useBatchId) {
|
|||||||
shoot_id = COALESCE(new.shoot_id, releases.shoot_id),
|
shoot_id = COALESCE(new.shoot_id, releases.shoot_id),
|
||||||
duration = COALESCE(new.duration, releases.duration),
|
duration = COALESCE(new.duration, releases.duration),
|
||||||
comment = COALESCE(new.comment, releases.comment),
|
comment = COALESCE(new.comment, releases.comment),
|
||||||
|
attributes = COALESCE(new.attributes::jsonb || releases.attributes::jsonb, new.attributes::jsonb, releases.attributes::jsonb),
|
||||||
deep = new.url IS NOT NULL,
|
deep = new.url IS NOT NULL,
|
||||||
updated_at = NOW()
|
updated_at = NOW()
|
||||||
FROM json_to_recordset(:scenes)
|
FROM json_to_recordset(:scenes)
|
||||||
AS new(id int, url text, date timestamptz, entity json, title text, description text, shoot_id text, duration integer, comment text, deep boolean)
|
AS new(id int, url text, date timestamptz, entity json, title text, description text, shoot_id text, duration integer, comment text, attributes json, deep boolean)
|
||||||
WHERE releases.id = new.id
|
WHERE releases.id = new.id
|
||||||
`, {
|
`, {
|
||||||
scenes: JSON.stringify(curatedDuplicateReleases),
|
scenes: JSON.stringify(curatedDuplicateReleases),
|
||||||
|
|||||||
Reference in New Issue
Block a user