mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-22 10:46:19 +01:00
api/youtube: use Math.min instead of ternary operator
This commit is contained in:
parent
0378a1ae15
commit
ec0d773792
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue