Fixed scenes without movies spawning empty movie objects and triggering 'missing entry ID' warning.

This commit is contained in:
DebaucheryLibrarian 2021-02-08 03:35:24 +01:00
parent fa57575cc3
commit dcad0cbe8f
3 changed files with 3 additions and 4 deletions

View File

@ -84,7 +84,7 @@ async function init() {
? await fetchScenes([...(sceneUrls), ...(updateBaseScenes || []), ...(actorBaseScenes || [])])
: [...(updateBaseScenes || []), ...(actorBaseScenes || [])];
const sceneMovies = deepScenes ? deepScenes.map(scene => ({ ...scene.movie, entity: scene.entity })).filter(Boolean) : [];
const sceneMovies = deepScenes ? deepScenes.filter(scene => scene.movie).map(scene => ({ ...scene.movie, entity: scene.entity })) : [];
const deepMovies = argv.sceneMovies || argv.movie ? await fetchMovies([...(argv.movie || []), ...(sceneMovies || [])]) : sceneMovies;
const movieScenes = argv.movieScenes ? deepMovies.map(movie => movie.scenes?.map(scene => ({ ...scene, movie, entity: movie.entity }))).flat().filter(Boolean) : [];

View File

@ -255,7 +255,8 @@ async function fetchLatest(entity, page, options) {
// release.poster = `http://${config.web.host}:${config.web.port}/img/${poster}?id=${nanoid()}`; // ensure source is unique
release.poster = `http://${config.web.host}:${config.web.port}/img/${poster}`; // ensure source is unique
release.photos = photos.map(photo => `http://${config.web.host}:${config.web.port}/img/${photo}?id=${nanoid()}`);
// release.photos = photos.map(photo => `http://${config.web.host}:${config.web.port}/img/${photo}?id=${nanoid()}`);
release.photos = [release.poster];
}
release.tags = await knex('tags')

View File

@ -356,8 +356,6 @@ async function associateMovieScenes(movies, movieScenes) {
return null;
}).filter(Boolean);
console.log(movies, movieScenes, associations);
await bulkInsert('movies_scenes', associations, false);
}