mirror of
https://github.com/imputnet/cobalt.git
synced 2025-01-22 06:21:41 +00:00
api/youtube: use Math.min instead of ternary operator
This commit is contained in:
parent
0378a1ae15
commit
ec0d773792
|
@ -240,7 +240,7 @@ export default async function (o) {
|
|||
const quality = o.quality === "max" ? 9000 : Number(o.quality);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue