Commit 501b067 1 parent 163b7bf commit 501b067 Copy full SHA for 501b067
File tree 5 files changed +13
-8
lines changed
5 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 1
1
export {
2
2
type CreateVideoRequestDto ,
3
+ type Scene ,
3
4
type UpdateVideoRequestDto ,
4
5
type UserGetCurrentResponseDto ,
5
6
type VideoGetAllItemResponseDto ,
Original file line number Diff line number Diff line change 1
- import { type UpdateVideoRequestDto } from '~/bundles/videos/types/types.js' ;
1
+ import {
2
+ type Scene ,
3
+ type UpdateVideoRequestDto ,
4
+ } from '~/bundles/videos/types/types.js' ;
2
5
import { VideoEntity } from '~/bundles/videos/video.entity.js' ;
3
6
import { type VideoModel } from '~/bundles/videos/video.model.js' ;
4
7
import { type ImageService } from '~/common/services/image/image.service.js' ;
@@ -65,7 +68,7 @@ class VideoRepository implements Repository {
65
68
if ( payload . composition ) {
66
69
data . composition = payload . composition ;
67
70
data . previewUrl = await this . imageService . generatePreview (
68
- payload . composition ,
71
+ payload . composition . scenes [ 0 ] as Scene ,
69
72
) ;
70
73
}
71
74
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { type Service } from '~/common/types/types.js';
8
8
import { VideoValidationMessage } from './enums/enums.js' ;
9
9
import {
10
10
type CreateVideoRequestDto ,
11
+ type Scene ,
11
12
type UpdateVideoRequestDto ,
12
13
type VideoGetAllItemResponseDto ,
13
14
type VideoGetAllResponseDto ,
@@ -61,7 +62,7 @@ class VideoService implements Service {
61
62
payload : CreateVideoRequestDto & { userId : string } ,
62
63
) : Promise < VideoGetAllItemResponseDto > {
63
64
const previewUrl = await this . imageService . generatePreview (
64
- payload . composition ,
65
+ payload . composition . scenes [ 0 ] as Scene ,
65
66
) ;
66
67
67
68
const video = await this . videoRepository . create (
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { type FileService } from '~/common/services/file/file.service.js';
4
4
5
5
import { PREVIEW_HEIGHT , PREVIEW_WIDTH } from './constants/constants.js' ;
6
6
import { type ImageApi } from './image-base.js' ;
7
- import { type Composition } from './types/types.js' ;
7
+ import { type Scene } from './types/types.js' ;
8
8
9
9
type Constructor = {
10
10
fileService : FileService ;
@@ -20,9 +20,9 @@ class ImageService {
20
20
this . imageApi = imageApi ;
21
21
}
22
22
23
- public async generatePreview ( composition : Composition ) : Promise < string > {
24
- const avatarImage = composition . scenes [ 0 ] ? .avatar ?. url ?? '' ;
25
- const background = composition . scenes [ 0 ] ? .background ;
23
+ public async generatePreview ( scene : Scene ) : Promise < string > {
24
+ const avatarImage = scene . avatar ?. url ?? '' ;
25
+ const background = scene . background ;
26
26
27
27
if ( background ?. url ) {
28
28
const backgroundImageBuffer = await this . imageApi . getImageBuffer (
Original file line number Diff line number Diff line change 1
- export { type Composition } from 'shared' ;
1
+ export { type Scene } from 'shared' ;
You can’t perform that action at this time.
0 commit comments