@@ -7,6 +7,8 @@ import { type DomainEvent } from '@api/domain/events/DomainEvent'
7
7
import { type Queue } from '@api/domain/queue/Queue'
8
8
import { inject } from '@api/infra/dependency-injection/Registry'
9
9
10
+ // Input should be '1:1', '16:9', '9:16', '4:3', '3:4', '21:9' or '9:21'",
11
+
10
12
export class RequestVideo {
11
13
@inject ( 'batchRepository' )
12
14
private readonly batchRepository ! : BatchRepository
@@ -24,7 +26,7 @@ export class RequestVideo {
24
26
if ( ! image ) throw new ImageNotFoundError ( )
25
27
imageUrl = `${ process . env . FILES_STORAGE } ${ image ?. path } `
26
28
}
27
- const batchConfiguration = Batch . getConfigurations ( input . gateway )
29
+ const batchConfiguration = Batch . configurationFactory ( { gateway : input . gateway , aspectRatio : input . aspectRatio } )
28
30
const batch = Batch . create ( {
29
31
prompt : input . prompt ,
30
32
author : input . author ,
@@ -35,7 +37,7 @@ export class RequestVideo {
35
37
repositoryBatch . register ( 'videoRequested' , async ( domainEvent : DomainEvent ) => {
36
38
await this . queue . publish ( domainEvent . eventName , domainEvent . data )
37
39
} )
38
- await repositoryBatch . requestVideo ( { gateway : input . gateway , dimensions : { width : input . width , height : input . height } , imageUrl } )
40
+ await repositoryBatch . requestVideo ( { gateway : input . gateway , aspectRatio : input . aspectRatio , imageUrl } )
39
41
return {
40
42
batchId : repositoryBatch . id ,
41
43
batchStatus : batch . status
0 commit comments