Skip to content

Commit 22f0dfb

Browse files
committed
fix(overlay): update subtitle overlay parameter to plural form
1 parent f9bd7c0 commit 22f0dfb

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/resources/helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ function processOverlay(overlay: Transformation['overlay']): string | undefined
284284
}
285285
break;
286286
case 'subtitle':
287-
entries.push('l-subtitle');
287+
entries.push('l-subtitles');
288288
{
289289
const subtitleOverlay = overlay as SubtitleOverlay;
290290
const encoding = subtitleOverlay.encoding || 'auto';

tests/custom-tests/url-generation/overlay.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ describe('Overlay Transformation Test Cases', function () {
173173
],
174174
});
175175
expect(url).toBe(
176-
`https://ik.imagekit.io/test_url_endpoint/tr:l-subtitle,i-subtitle.srt,l-end/base-video.mp4`,
176+
`https://ik.imagekit.io/test_url_endpoint/tr:l-subtitles,i-subtitle.srt,l-end/base-video.mp4`,
177177
);
178178
});
179179

@@ -347,7 +347,7 @@ describe('Overlay Transformation Test Cases', function () {
347347
});
348348

349349
expect(url).toBe(
350-
`https://ik.imagekit.io/test_url_endpoint/tr:l-text,i-Every%20thing,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,fs-20,ff-Arial,co-0000ff,ia-left,pa-5,al-7,tg-b,bg-red,r-10,rt-N45,fl-h,lh-20,l-end:l-image,i-logo.png,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,h-bh_mul_0.5,rt-N45,fl-h,l-text,i-Nested%20text%20overlay,l-end,l-end:l-video,i-play-pause-loop.mp4,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,h-bh_mul_0.5,rt-N45,fl-h,l-end:l-subtitle,i-subtitle.srt,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,bg-red,co-0000ff,ff-Arial,fol-2_A1CCDD50,fsh-A1CCDD_3,l-end:l-image,i-ik_canvas,bg-FF0000,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,h-bh_mul_0.5,al-0.5,bg-red,e-gradient,r-max,l-end/base-image.jpg`,
350+
`https://ik.imagekit.io/test_url_endpoint/tr:l-text,i-Every%20thing,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,fs-20,ff-Arial,co-0000ff,ia-left,pa-5,al-7,tg-b,bg-red,r-10,rt-N45,fl-h,lh-20,l-end:l-image,i-logo.png,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,h-bh_mul_0.5,rt-N45,fl-h,l-text,i-Nested%20text%20overlay,l-end,l-end:l-video,i-play-pause-loop.mp4,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,h-bh_mul_0.5,rt-N45,fl-h,l-end:l-subtitles,i-subtitle.srt,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,bg-red,co-0000ff,ff-Arial,fol-2_A1CCDD50,fsh-A1CCDD_3,l-end:l-image,i-ik_canvas,bg-FF0000,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,w-bw_mul_0.5,h-bh_mul_0.5,al-0.5,bg-red,e-gradient,r-max,l-end/base-image.jpg`,
351351
);
352352
});
353353

@@ -678,7 +678,7 @@ describe('Overlay encoding test cases', function () {
678678
},
679679
],
680680
});
681-
expect(url).toBe(`https://ik.imagekit.io/demo/tr:l-subtitle,i-sub.srt,l-end/sample.mp4`);
681+
expect(url).toBe(`https://ik.imagekit.io/demo/tr:l-subtitles,i-sub.srt,l-end/sample.mp4`);
682682
});
683683

684684
it('should use base64 encoding when explicitly specified for subtitle overlay', function () {
@@ -697,7 +697,7 @@ describe('Overlay encoding test cases', function () {
697697
],
698698
});
699699
expect(url).toBe(
700-
`https://ik.imagekit.io/demo/tr:l-subtitle,ie-${encodeURIComponent(
700+
`https://ik.imagekit.io/demo/tr:l-subtitles,ie-${encodeURIComponent(
701701
safeBtoa('sub.srt'),
702702
)},l-end/sample.mp4`,
703703
);

0 commit comments

Comments
 (0)