Skip to content

Commit

Permalink
Merge branch 'next' into task/OV-377-create-preview-page
Browse files Browse the repository at this point in the history
  • Loading branch information
stefano-lacorazza committed Sep 27, 2024
2 parents 89fd45d + 5d80b99 commit b012825
Show file tree
Hide file tree
Showing 125 changed files with 3,291 additions and 218 deletions.
3 changes: 3 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"migrate:dev:make": "node --loader ts-paths-esm-loader ../node_modules/knex/bin/cli.js migrate:make -x ts",
"migrate:dev:down": "node --loader ts-paths-esm-loader ../node_modules/knex/bin/cli.js migrate:down",
"migrate:dev:rollback": "node --loader ts-paths-esm-loader ../node_modules/knex/bin/cli.js migrate:rollback --all",
"seed:make": "node --loader ts-paths-esm-loader ../node_modules/knex/bin/cli.js seed:make -x ts",
"seed:run": "node --loader ts-paths-esm-loader ../node_modules/knex/bin/cli.js seed:run",
"build": "tsc && tsc-alias",
"start": "node ./src/index.js"
},
Expand Down Expand Up @@ -53,6 +55,7 @@
"pino": "9.3.2",
"pino-pretty": "10.3.1",
"shared": "*",
"sharp": "0.33.5",
"socket.io": "4.7.5",
"swagger-jsdoc": "6.2.8",
"tiktoken": "1.0.16"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,22 @@ class ScriptProcessor {
voice: string;
scene: Scene;
}): void {
if (text && this.currentAvatar) {
if (!text || !this.currentAvatar) {
return;
}

const lastScene = this.result.at(-1);

if (
lastScene &&
lastScene.avatar.voice === voice &&
lastScene.avatar.name === this.currentAvatar.name &&
lastScene.avatar.style === this.currentAvatar.style &&
JSON.stringify(lastScene.background) ===
JSON.stringify(scene.background)
) {
lastScene.avatar.text += ' ' + text;
} else {
this.result.push({
...scene,
id: uuidv4(),
Expand Down
3 changes: 2 additions & 1 deletion backend/src/bundles/public-video/public-videos.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { VideoModel } from '~/bundles/videos/video.model.js';
import { VideoRepository } from '~/bundles/videos/video.repository.js';
import { logger } from '~/common/logger/logger.js';
import { imageService } from '~/common/services/services.js';

import { PublicVideoController } from './public-video.controller.js';
import { PublicVideoService } from './public-video.service.js';

const videoRepository = new VideoRepository(VideoModel);
const videoRepository = new VideoRepository(VideoModel, imageService);
const videoService = new PublicVideoService(videoRepository);
const publicVideoController = new PublicVideoController(logger, videoService);

Expand Down
2 changes: 2 additions & 0 deletions backend/src/bundles/templates/enums/enums.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { templateErrorMessage } from './template-error-message.enum.js';
export { templateApiPath } from './templates-api-path.enum.js';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const templateErrorMessage = {
YOU_CAN_NOT_DELETE_THIS_TEMPLATE: 'You can not delete this template',
YOU_CAN_NOT_UPDATE_THIS_TEMPLATE: 'You can not update this template',
TEMPLATE_DOES_NOT_EXIST: 'Template does not exist',
} as const;

export { templateErrorMessage };
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const templateApiPath = {
ROOT: '/',
ID: '/:id',
PUBLIC: '/public',
USER: '/user',
} as const;

export { templateApiPath };
Loading

0 comments on commit b012825

Please sign in to comment.