diff --git a/package-lock.json b/package-lock.json index faf9541..acabc6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "videodb", - "version": "0.1.3-alpha", + "version": "0.1.3-beta", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "videodb", - "version": "0.1.3-alpha", + "version": "0.1.3-beta", "license": "Apache-2.0", "dependencies": { "axios": "^1.6.2", diff --git a/package.json b/package.json index dc16998..b5fc3cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "videodb", - "version": "0.1.3-beta", + "version": "0.1.3", "description": "A NodeJS wrapper for VideoDB's API written in TypeScript", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/core/config.ts b/src/core/config.ts index 999711c..c19f84e 100644 --- a/src/core/config.ts +++ b/src/core/config.ts @@ -76,12 +76,12 @@ export enum SearchTypeValues { } export enum IndexTypeValues { - spoken = 'spoken', + spoken_word = 'spoken_word', scene = 'scene', } export const DefaultSearchType = SearchTypeValues.semantic; -export const DefaultIndexType = IndexTypeValues.spoken; +export const DefaultIndexType = IndexTypeValues.spoken_word; export const SceneExtractionType = { shotBased: 'shot', diff --git a/src/core/search/index.ts b/src/core/search/index.ts index 0180015..3cca86d 100644 --- a/src/core/search/index.ts +++ b/src/core/search/index.ts @@ -66,7 +66,8 @@ class SemanticSearch data: SemanticVideoSearch | SemanticCollectionSearch ) => { return { - index_type: SearchTypeValues.semantic, + search_type: SearchTypeValues.semantic, + index_type: data.indexType, query: data.query, score_threshold: data.scoreThreshold ?? SemanticSearchDefaultValues.scoreThreshold, @@ -106,7 +107,8 @@ class KeywordSearch data: KeywordVideoSearch | KeywordCollectionSearch ) => { return { - index_type: SearchTypeValues.keyword, + search_type: SearchTypeValues.keyword, + index_type: data.indexType, query: data.query, score_threshold: data.scoreThreshold ?? KeywordSearchDefaultValues.scoreThreshold, diff --git a/src/core/video.ts b/src/core/video.ts index 66ecb22..28c0f08 100644 --- a/src/core/video.ts +++ b/src/core/video.ts @@ -157,7 +157,7 @@ export class Video implements IVideo { const indexJob = new IndexJob( this.#vhttp, this.meta.id, - IndexTypeValues.spoken + IndexTypeValues.spoken_word ); return indexJob; }; diff --git a/src/utils/job.ts b/src/utils/job.ts index 72ab9af..e11cb8c 100644 --- a/src/utils/job.ts +++ b/src/utils/job.ts @@ -270,7 +270,7 @@ export class IndexJob extends Job { * On sucess, it calls the index endpoint */ public start = async () => { - if (this.indexConfig.indexType === IndexTypeValues.spoken) { + if (this.indexConfig.indexType === IndexTypeValues.spoken_word) { const transcriptJob = new TranscriptJob(this.vhttp, this.videoId); const reqData = fromCamelToSnake(this.indexConfig); transcriptJob.on('success', async () => {