File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 11
11
12
12
use OCA \OpenAi \AppInfo \Application ;
13
13
use OCA \OpenAi \Service \OpenAiAPIService ;
14
- use OCP \Http \Client \IClientService ;
15
14
use OCP \IAppConfig ;
16
15
use OCP \IL10N ;
17
16
use OCP \TaskProcessing \EShapeType ;
18
17
use OCP \TaskProcessing \ISynchronousProvider ;
19
18
use OCP \TaskProcessing \ShapeDescriptor ;
20
19
use OCP \TaskProcessing \ShapeEnumValue ;
21
- use OCP \TaskProcessing \TaskTypes \TextToSpeech ;
22
20
use Psr \Log \LoggerInterface ;
23
21
use RuntimeException ;
24
22
@@ -44,7 +42,10 @@ public function getName(): string {
44
42
}
45
43
46
44
public function getTaskTypeId (): string {
47
- return TextToSpeech::ID ;
45
+ if (class_exists ('OCP \\TaskProcessing \\TaskTypes \\TextToTextChangeTone ' )) {
46
+ return \OCP \TaskProcessing \TaskTypes \TextToSpeech::ID ;
47
+ }
48
+ return TextToSpeechTaskType::ID ;
48
49
}
49
50
50
51
public function getExpectedRuntime (): int {
Original file line number Diff line number Diff line change @@ -213,6 +213,7 @@ public function testEmojiProvider(): void {
213
213
$ iResponse = $ this ->createMock (\OCP \Http \Client \IResponse::class);
214
214
$ iResponse ->method ('getBody ' )->willReturn ($ response );
215
215
$ iResponse ->method ('getStatusCode ' )->willReturn (200 );
216
+ $ iResponse ->method ('getHeader ' )->with ('Content-Type ' )->willReturn ('application/json ' );
216
217
217
218
$ this ->iClient ->expects ($ this ->once ())->method ('post ' )->with ($ url , $ options )->willReturn ($ iResponse );
218
219
You can’t perform that action at this time.
0 commit comments