1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Apply suggestions from code review

Co-authored-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com>
This commit is contained in:
gnattu 2024-09-14 17:42:41 +08:00 committed by GitHub
parent 2bb60e2241
commit 994118b899
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,14 +36,14 @@ export function getVideoQualityOptions(options) {
qualityOptions.push(autoQualityOption);
}
if (videoBitRate > 0 && videoBitRate < 120000000) {
if (videoBitRate > 0 && videoBitRate < bitrateConfigurations[0].bitrate) {
// Push one entry that has higher limit than video bitrate to allow using source bitrate when Auto is also limited
const sourceOptions = minBy(bitrateConfigurations.filter((c) => c.bitrate > videoBitRate), (x) => x.bitrate);
qualityOptions.push(sourceOptions);
}
bitrateConfigurations.forEach((c) => {
if (videoBitRate < 0 || (videoBitRate > 0 && c.bitrate < videoBitRate)) {
if (videoBitRate <= 0 || c.bitrate <= videoBitRate) {
qualityOptions.push(c);
}
});