Added manticore sync all tool, updated manticore driver.

This commit is contained in:
2026-11-12 02:18:13 +01:00
parent de05075def
commit f5e3a8a2ae
7 changed files with 175 additions and 151 deletions
+33 -40
View File
@@ -1,49 +1,42 @@
import argv from '../src/argv.js';
import { knexOwner as knex } from '../src/knex.js';
import { utilsApi } from '../src/manticore.js';
import redis from '../src/redis.js';
import { syncManticoreActors } from '../src/sync.js';
import runTool from './run-tool.js';
async function init() {
if (argv.update) {
await utilsApi.sql('drop table if exists actors');
// bigint rather than timestamp, which is unsigned 32-bit and wraps dates before 1970 into the 2100s
await utilsApi.sql(`create table actors(
id int,
name text,
aliases text,
slug string,
entity_id int,
alias_for int,
gender string,
date_of_birth bigint,
country string,
has_avatar bool,
mass int,
height int,
cup string,
natural_boobs int,
penis_length int,
penis_girth int,
stashed int,
scenes int
) min_prefix_len = '3'`);
export async function rebuildActors() {
await utilsApi.sql('drop table if exists actors');
// bigint rather than timestamp, which is unsigned 32-bit and wraps dates before 1970 into the 2100s
await utilsApi.sql(`create table actors(
id int,
name text,
aliases text,
slug string,
entity_id int,
alias_for int,
gender string,
date_of_birth bigint,
country string,
has_avatar bool,
mass int,
height int,
cup string,
natural_boobs int,
penis_length int,
penis_girth int,
stashed int,
scenes int
) min_prefix_len = '3'`);
console.log('Recreated actors table, syncing actors...');
console.log('Recreated actors table, syncing actors...');
const data = await syncManticoreActors();
console.log('data', data);
await knex.destroy();
await redis.quit(); // sync imports connect to redis, which keeps the process alive
return;
}
await knex.destroy();
await redis.quit(); // sync imports connect to redis, which keeps the process alive
await syncManticoreActors();
}
init();
if (import.meta.main) {
runTool(async () => {
if (argv.update) {
await rebuildActors();
}
});
}