Skip to content

Commit f598166

Browse files
committed
fix: address review comments, rename a constant, use a unused constant
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
1 parent d2c98d8 commit f598166

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/AppInfo/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Application extends App implements IBootstrap {
5353
'onyx', 'nova', 'sage', 'shimmer', 'verse'
5454
];
5555
public const DEFAULT_SUBTITLE_FORMAT = 'srt';
56-
public const DEFAULT_SUBTITLE_FORMATS = [
56+
public const SUPPORTED_SUBTITLE_FORMATS = [
5757
'srt', 'vtt'
5858
];
5959
public const DEFAULT_DEFAULT_IMAGE_SIZE = '1024x1024';

lib/Service/OpenAiAPIService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ public function transcribe(
930930

931931
$response = $this->request($userId, $endpoint, $params, 'POST', $contentType, serviceType: Application::SERVICE_TYPE_STT);
932932

933-
if (in_array($responseFormat, Application::DEFAULT_SUBTITLE_FORMATS)) {
933+
if (in_array($responseFormat, Application::SUPPORTED_SUBTITLE_FORMATS)) {
934934
if (!isset($response['body'])) {
935935
$this->logger->warning('Audio subtitling error: ' . json_encode($response));
936936
throw new Exception($this->l10n->t('Unknown audio subtitling error'), Http::STATUS_INTERNAL_SERVER_ERROR);

lib/TaskProcessing/AudioToTextSubtitlesProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function getOptionalInputShapeEnumValues(): array {
9090
public function getOptionalInputShapeDefaults(): array {
9191
return [
9292
'language' => 'default',
93-
'format' => 'srt',
93+
'format' => Application::DEFAULT_SUBTITLE_FORMAT,
9494
];
9595
}
9696

0 commit comments

Comments
 (0)