Files
traxxx-web/tools/manticore-actors.js
T

43 lines
950 B
JavaScript

import argv from '../src/argv.js';
import { utilsApi } from '../src/manticore.js';
import { syncManticoreActors } from '../src/sync.js';
import runTool from './run-tool.js';
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...');
await syncManticoreActors();
}
if (import.meta.main) {
runTool(async () => {
if (argv.update) {
await rebuildActors();
}
});
}