feat: add 4K and 2K quality tiers

This commit is contained in:
2026-08-11 15:18:35 +02:00
parent e0ef1dee77
commit 0d46a9a099
2 changed files with 22 additions and 1 deletions
+21
View File
@@ -39,6 +39,27 @@ describe('parseProbeOutput', () => {
expect(result.subtitleLangs).toEqual(['fr', 'en', 'es'])
})
it('includes 4K and 2K when the source tops out at 4K', () => {
const result = parseProbeOutput(json({
formats: [
{ height: 1080, vcodec: 'avc1' },
{ height: 1440, vcodec: 'avc1' },
{ height: 2160, vcodec: 'avc1' },
],
}))
expect(result.availableQualities).toEqual(['best', '2160p', '1440p', '1080p', '720p', '480p', '360p'])
})
it('includes 2K but excludes 4K when the source tops out below 4K', () => {
const result = parseProbeOutput(json({
formats: [
{ height: 1080, vcodec: 'avc1' },
{ height: 1440, vcodec: 'avc1' },
],
}))
expect(result.availableQualities).toEqual(['best', '1440p', '1080p', '720p', '480p', '360p'])
})
it('caps available qualities to the max height found', () => {
const result = parseProbeOutput(json({
formats: [
+1 -1
View File
@@ -1,3 +1,3 @@
export const FORMATS = ['mp4', 'mp3', 'webm', 'mkv'] as const
export const QUALITIES = ['best', '1080p', '720p', '480p', '360p'] as const
export const QUALITIES = ['best', '2160p', '1440p', '1080p', '720p', '480p', '360p'] as const
export const AUDIO_QUALITIES = ['best', '192', '128'] as const