Compare commits

...

3 Commits

Author SHA1 Message Date
DebaucheryLibrarian
37b92209f0 Added attributes migration. 2026-02-03 05:34:14 +01:00
DebaucheryLibrarian
9754f9e9af 1.248.21 2026-02-03 05:33:51 +01:00
DebaucheryLibrarian
ccd833665f Added attributes field to help with entry ID migrations, trial with Team Skeet. 2026-02-03 05:33:47 +01:00
5 changed files with 30 additions and 4 deletions

View 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
View File

@@ -1,12 +1,12 @@
{
"name": "traxxx",
"version": "1.248.20",
"version": "1.248.21",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "traxxx",
"version": "1.248.20",
"version": "1.248.21",
"license": "ISC",
"dependencies": {
"@aws-sdk/client-s3": "^3.458.0",

View File

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

View File

@@ -45,6 +45,11 @@ async function scrapeScene(scene, channel, parameters, includeTrailers) {
const release = {};
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.title = scene.title;

View File

@@ -54,6 +54,7 @@ async function curateReleaseEntry(release, batchId, existingRelease, type = 'sce
slug,
description: decode(release.description),
comment: release.comment,
attributes: release.attributes,
photo_count: Number(release.photoCount) || null,
deep: typeof release.deep === 'boolean' ? release.deep : false,
deep_url: release.deepUrl,
@@ -439,10 +440,11 @@ async function storeScenes(releases, useBatchId) {
shoot_id = COALESCE(new.shoot_id, releases.shoot_id),
duration = COALESCE(new.duration, releases.duration),
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,
updated_at = NOW()
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
`, {
scenes: JSON.stringify(curatedDuplicateReleases),