Added virtual entity spawning for multi-page updates (i.e. Elegant Angel). Fixed ffmpeg error freezing process. Refactored Adult Empire/Elegant Angel scraper.

This commit is contained in:
DebaucheryLibrarian
2024-08-16 23:26:52 +02:00
parent 958c6d83fa
commit bca677b0a8
16 changed files with 287 additions and 249 deletions

View File

@@ -288,23 +288,28 @@ async function associateMovieScenes(movies, movieScenes) {
},
}), {});
const associations = movieScenes.map((scene) => {
if (!scene.movie) {
const associations = movieScenes
.toSorted((sceneA, sceneB) => {
return (sceneA.sceneIndex || 1) - (sceneB.sceneIndex || 1);
})
.map((scene) => {
if (!scene.movie) {
return null;
}
const sceneMovie = moviesByEntityIdAndEntryId[scene.entity.id]?.[scene.movie.entryId]
|| moviesByEntityIdAndEntryId[scene.entity.parent?.id]?.[scene.movie.entryId];
if (sceneMovie?.id) {
return {
movie_id: sceneMovie.id,
scene_id: scene.id,
};
}
return null;
}
const sceneMovie = moviesByEntityIdAndEntryId[scene.entity.id]?.[scene.movie.entryId]
|| moviesByEntityIdAndEntryId[scene.entity.parent?.id]?.[scene.movie.entryId];
if (sceneMovie?.id) {
return {
movie_id: sceneMovie.id,
scene_id: scene.id,
};
}
return null;
}).filter(Boolean);
})
.filter(Boolean);
await bulkInsert('movies_scenes', associations, false);
}
@@ -354,6 +359,7 @@ async function storeMovies(movies, useBatchId) {
await updateMovieSearch(moviesWithId.map((movie) => movie.id));
await associateReleaseMedia(moviesWithId, 'movie');
await associateReleaseTags(moviesWithId, 'movie');
return moviesWithId;
}