Added actor stash.

This commit is contained in:
2024-03-21 02:54:05 +01:00
parent 9b50b53df6
commit a8aab600c7
37 changed files with 1292 additions and 490 deletions

View File

@@ -2,7 +2,7 @@
import { format } from 'date-fns';
import { faker } from '@faker-js/faker';
import { indexApi, utilsApi } from '../manticore.js';
import { indexApi } from '../manticore.js';
import { knexOwner as knex } from '../knex.js';
import slugify from '../utils/slugify.js';
@@ -105,11 +105,11 @@ async function updateStashed(docs) {
const stashDoc = sceneStashes.map((stash) => ({
replace: {
index: 'movies_liked',
index: 'scenes_stashed',
id: stash.stashed_id,
doc: {
// ...doc.replace.doc,
movie_id: doc.replace.id,
scene_id: doc.replace.id,
user_id: stash.user_id,
},
},
@@ -127,35 +127,6 @@ async function updateStashed(docs) {
}
async function init() {
await utilsApi.sql('drop table if exists movies');
await utilsApi.sql('drop table if exists movies_liked');
await utilsApi.sql(`create table movies (
id int,
title text,
title_filtered text,
channel_id int,
channel_name text,
channel_slug text,
network_id int,
network_name text,
network_slug text,
actor_ids multi,
actors text,
tag_ids multi,
tags text,
meta text,
date timestamp,
created_at timestamp,
effective_date timestamp,
liked int
)`);
await utilsApi.sql(`create table movies_liked (
movie_id int,
user_id int
)`);
const scenes = await fetchScenes();
const docs = scenes.map((scene) => {
@@ -165,7 +136,7 @@ async function init() {
return {
replace: {
index: 'movies',
index: 'scenes',
id: scene.id,
doc: {
title: scene.title || undefined,