diff --git a/src/tools/julesjordan-fix.js b/src/tools/julesjordan-fix.js deleted file mode 100644 index 0fcbddc7..00000000 --- a/src/tools/julesjordan-fix.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -// const config = require('config'); -const initKnex = require('knex'); -// const unprint = require('unprint'); -// const args = require('yargs').argv; -// const stashes = require('./julesjordan_stashes.json'); -const slugify = require('../utils/slugify'); - -async function init() { - const knex = initKnex({ - client: 'pg', - connection: { - host: 'syskill.unknown.name', - user: 'traxxx', - password: 'YGDdBeXZXE25gKuzh5g7u4RV61G00XP6', - database: 'traxxx', - }, - asyncStackTraces: true, - }); - - const results = await knex('releases') - .select('releases.*', knex.raw('json_agg(actors.name) as actor_names')) - .leftJoin('entities', 'entities.id', 'releases.entity_id') - .leftJoin('releases_actors', 'releases_actors.release_id', 'releases.id') - .leftJoin('actors', 'actors.id', 'releases_actors.actor_id') - .whereIn('entities.slug', ['julesjordan']) - .groupBy('releases.id'); - - await knex.transaction(async (trx) => { - return results.reduce(async (chain, scene) => { - await chain; - - // const newEntryId = scene.entry_id.replace(/-\d{4}-\d{2}-\d{2}$/, ''); // remove date - const newEntryId = slugify([scene.title, ...(scene.actor_names?.toSorted() || [])]); - - console.log(newEntryId); - - await trx('releases') - .where('id', scene.id) - .update({ - entry_id: newEntryId, - comment: `old entry id: ${scene.entry_id}`, - }); - }, Promise.resolve()); - }); - - knex.destroy(); -} - -init(); diff --git a/src/tools/whalemember-fix.js b/src/tools/whalemember-fix.js deleted file mode 100644 index 0cc38bd8..00000000 --- a/src/tools/whalemember-fix.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -// const config = require('config'); -const initKnex = require('knex'); -// const args = require('yargs').argv; - -async function init() { - const knex = initKnex({ - client: 'pg', - connection: { - host: '135.125.235.53', - user: 'traxxx', - password: 'YGDdBeXZXE25gKuzh5g7u4RV61G00XP6', - database: 'traxxx', - }, - asyncStackTraces: true, - }); - - const results = await knex('releases') - .select('releases.*') - .leftJoin('entities', 'entities.id', 'releases.entity_id') - .leftJoin('entities as networks', 'networks.id', 'entities.parent_id') - .whereIn('networks.slug', ['whalemember', 'pornpros']); - - console.log(results.length); - - await knex('releases') - .whereIn('id', results.map((result) => result.id)) - .update('entry_id', knex.raw('split_part(releases.url, \'/\', -1)')); - - knex.destroy(); -} - -init();