Fixed movie IDs in manticore search query. Fixed animated media identification.
This commit is contained in:
parent
f8c38fa1fe
commit
ded7fe0595
|
@ -420,10 +420,14 @@ async function storeS3Object(filepath, media) {
|
|||
|
||||
async function writeImage(image, media, info, filepath, isProcessed) {
|
||||
if (isProcessed && info.pages) {
|
||||
const imageBuffer = await image.toBuffer();
|
||||
// convert animated image to WebP and write to permanent location
|
||||
await fs.promises.writeFile(path.join(config.media.path, filepath), imageBuffer);
|
||||
/*
|
||||
await image
|
||||
.webp()
|
||||
.toFile(path.join(config.media.path, filepath));
|
||||
*/
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -476,7 +480,7 @@ async function storeImageFile(media, hashDir, hashSubDir, filename, filedir, fil
|
|||
fsPromises.mkdir(path.join(config.media.path, lazydir), { recursive: true }),
|
||||
]);
|
||||
|
||||
const image = sharp(media.file.path, { pages: ['trailer', 'teaser'].includes(media.role) ? -1 : 1 }); // don't store posters as animation
|
||||
const image = sharp(media.file.path, { pages: ['trailers', 'teasers'].includes(media.role) ? -1 : 1 }); // don't store posters as animation
|
||||
const isProcessed = media.meta.subtype !== 'jpeg' || media.process;
|
||||
|
||||
const [info, stats] = await Promise.all([
|
||||
|
|
|
@ -54,7 +54,7 @@ async function updateManticoreStashedScenes(docs) {
|
|||
}
|
||||
|
||||
async function updateManticoreSceneSearch(releaseIds) {
|
||||
logger.info(`Updating Manticore search documents for ${releaseIds ? releaseIds.length : 'all' } releases`);
|
||||
logger.info(`Updating Manticore search documents for ${releaseIds ? releaseIds.length : 'all' } scenes`);
|
||||
|
||||
const scenes = await knex.raw(`
|
||||
SELECT
|
||||
|
@ -161,7 +161,7 @@ async function updateManticoreSceneSearch(releaseIds) {
|
|||
actors: scene.actors.map((actor) => actor.f2).join(),
|
||||
tag_ids: scene.tags.map((tag) => tag.f1),
|
||||
tags: flatTags.join(' '), // only make top tags searchable to minimize cluttered results
|
||||
movie_ids: scene.movies,
|
||||
movie_ids: scene.movies.map((movie) => movie.f1),
|
||||
movies: scene.movies.map((movie) => movie.f2).join(' '),
|
||||
serie_ids: scene.series.map((serie) => serie.f1),
|
||||
series: scene.series.map((serie) => serie.f2).join(' '),
|
||||
|
@ -235,6 +235,8 @@ async function updateSceneSearch(releaseIds) {
|
|||
}
|
||||
|
||||
async function updateManticoreMovieSearch(movieIds) {
|
||||
logger.info(`Updating Manticore search documents for ${movieIds ? movieIds.length : 'all' } movies`);
|
||||
|
||||
const movies = await knex.raw(`
|
||||
SELECT
|
||||
movies.id AS id,
|
||||
|
|
Loading…
Reference in New Issue