From 121fdfd38bea10d7aca92cee5aa329c8fac22e54 Mon Sep 17 00:00:00 2001 From: jygaulier Date: Thu, 9 Jan 2025 16:50:53 +0100 Subject: [PATCH] fix validate errors --- .../src/handlers/phraseanet/indexer.ts | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/databox/indexer/src/handlers/phraseanet/indexer.ts b/databox/indexer/src/handlers/phraseanet/indexer.ts index 3106bef78..03b3b0f0b 100644 --- a/databox/indexer/src/handlers/phraseanet/indexer.ts +++ b/databox/indexer/src/handlers/phraseanet/indexer.ts @@ -20,7 +20,7 @@ import {escapePath, escapeSlashes, splitPath} from '../../lib/pathUtils'; import {AttributeDefinition, Tag} from '../../databox/types'; import Twig from 'twig'; import {Logger} from 'winston'; -import {DataboxClient} from '../../databox/client.ts'; +import {DataboxClient} from '../../databox/client'; export const phraseanetIndexer: IndexIterator = async function* (location, logger, databoxClient, options) { @@ -135,7 +135,7 @@ export const phraseanetIndexer: IndexIterator = importStories = true; } - const sourceCollections = await getSourceCollections(databoxClient, workspaceId, phraseanetDatabox, dm, collectionKeyPrefix, logger); + const sourceCollections = await getSourceCollections(phraseanetDatabox, dm, logger); const searchParams = { bases: sourceCollections, // if empty (no collections on config) : search all collections }; @@ -234,8 +234,8 @@ export const phraseanetIndexer: IndexIterator = const template = Twig.twig({data: ct}); const paths = (await template.renderAsync({record: r, collection: phraseanetDatabox.collections[r.base_id]})) .split('\n') - .map(p => p.trim()) - .filter(p => p); + .map((p: string) => p.trim()) + .filter((p: string) => p); for (const path of paths) { const branch = splitPath(path); @@ -285,11 +285,8 @@ export const phraseanetIndexer: IndexIterator = }; async function getSourceCollections( - databoxClient: DataboxClient, - workspaceId: string, phraseanetDatabox: PhraseanetDatabox, dm: ConfigDataboxMapping, - collectionKeyPrefix: string, logger: Logger ): Promise { const sourceCollections: string[] = []; @@ -736,17 +733,18 @@ function translateVideoSettings(sd: PhraseanetSubdefStruct): object { function translateVideoSettings_withVcodec(sd: PhraseanetSubdefStruct): object { // todo : acodec, formats, ... - let format; + let format: string; switch(sd.options['vcodec'] ?? '') { - case 'libx264': - format = 'video-mp4'; - break; case 'libvpx': format = 'video-webm'; break; case 'libtheora': format = 'video-webm'; break; + case 'libx264': + default: + format = 'video-mp4'; + break; } const size = sd.options['size'] ?? 100; let ffmpegModuleOptions: any = { @@ -836,7 +834,7 @@ function translateVideoSettings_withIcodec(sd: PhraseanetSubdefStruct): object { } function translateVideoSettings_targetImageFrame(sd: PhraseanetSubdefStruct): object { - let format; + let format: string; switch (sd.options['icodec'] ?? '') { case 'jpeg': format = 'image-jpeg';