api/youtube: use Math.min instead of ternary operator

This commit is contained in:
jj 2025-01-20 12:38:12 +00:00
parent 0378a1ae15
commit ec0d773792
No known key found for this signature in database

View file

@ -240,7 +240,7 @@ export default async function (o) {
const quality = o.quality === "max" ? 9000 : Number(o.quality); const quality = o.quality === "max" ? 9000 : Number(o.quality);
const normalizeQuality = res => { const normalizeQuality = res => {
const shortestSide = res.height > res.width ? res.width : res.height; const shortestSide = Math.min(res.height, res.width);
return videoQualities.find(qual => qual >= shortestSide); return videoQualities.find(qual => qual >= shortestSide);
} }