forked from DebaucheryLibrarian/traxxx
Fixed scenes without movies spawning empty movie objects and triggering 'missing entry ID' warning.
This commit is contained in:
parent
fa57575cc3
commit
dcad0cbe8f
|
@ -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) : [];
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -356,8 +356,6 @@ async function associateMovieScenes(movies, movieScenes) {
|
|||
return null;
|
||||
}).filter(Boolean);
|
||||
|
||||
console.log(movies, movieScenes, associations);
|
||||
|
||||
await bulkInsert('movies_scenes', associations, false);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue