Skip to content

Commit 584c9ba

Browse files
committed
fix: update subtitle overlay key from 'l-subtitle' to 'l-subtitles' in URL generation
1 parent be9db7a commit 584c9ba

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/url.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function processOverlay(overlay: Transformation["overlay"]): string | undefined
166166
}
167167
break;
168168
case "subtitle":
169-
entries.push("l-subtitle");
169+
entries.push("l-subtitles");
170170
{
171171
const subtitleOverlay = overlay as SubtitleOverlay;
172172
const enccoding = subtitleOverlay.encoding || "auto";

test/url-generation/overlay.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ describe("Overlay Transformation Test Cases", function () {
145145
}
146146
}]
147147
});
148-
expect(url).equal(`https://ik.imagekit.io/test_url_endpoint/tr:l-subtitle,i-subtitle.srt,l-end/base-video.mp4`);
148+
expect(url).equal(`https://ik.imagekit.io/test_url_endpoint/tr:l-subtitles,i-subtitle.srt,l-end/base-video.mp4`);
149149
});
150150

151151
it("Solid color overlay generates correct URL with background color FF0000", function () {
@@ -302,7 +302,7 @@ describe("Overlay Transformation Test Cases", function () {
302302
]
303303
});
304304

305-
expect(url).equal(`https://ik.imagekit.io/test_url_endpoint/tr:l-text,i-${encodeURIComponent("Every thing")},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-${encodeURIComponent("Nested text overlay")},l-end,l-end:l-video,i-play-pause-loop.mp4,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,l-end:l-subtitle,i-subtitle.srt,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,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,rt-N45,fl-h,l-end/base-image.jpg`);
305+
expect(url).equal(`https://ik.imagekit.io/test_url_endpoint/tr:l-text,i-${encodeURIComponent("Every thing")},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-${encodeURIComponent("Nested text overlay")},l-end,l-end:l-video,i-play-pause-loop.mp4,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,l-end:l-subtitles,i-subtitle.srt,lx-10,ly-20,lfo-center,lso-5,leo-15,ldu-10,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,rt-N45,fl-h,l-end/base-image.jpg`);
306306
});
307307
});
308308

@@ -476,7 +476,7 @@ describe("Overlay encoding test cases", function () {
476476
}
477477
}]
478478
});
479-
expect(url).equal(`https://ik.imagekit.io/demo/tr:l-subtitle,i-sub.srt,l-end/sample.mp4`);
479+
expect(url).equal(`https://ik.imagekit.io/demo/tr:l-subtitles,i-sub.srt,l-end/sample.mp4`);
480480
});
481481

482482
it('Subtitle overlay with explicit base64 encoding', function () {
@@ -492,7 +492,7 @@ describe("Overlay encoding test cases", function () {
492492
}
493493
}]
494494
});
495-
expect(url).equal(`https://ik.imagekit.io/demo/tr:l-subtitle,ie-${encodeURIComponent(safeBtoa("sub.srt"))},l-end/sample.mp4`);
495+
expect(url).equal(`https://ik.imagekit.io/demo/tr:l-subtitles,ie-${encodeURIComponent(safeBtoa("sub.srt"))},l-end/sample.mp4`);
496496
});
497497

498498
it("Avoid double encoding when transformation string is in query params", function () {

0 commit comments

Comments
 (0)