Update database/update.js

This commit is contained in:
Aleksandr Statciuk 2022-02-13 04:45:15 +03:00
parent 8b6bee2ed3
commit fd60c886fe
3 changed files with 7 additions and 5 deletions

View file

@ -135,8 +135,10 @@ function parseStreams(streams) {
.filter(s => s.codec_type === 'video')
.reduce(
(acc, curr) => {
if (curr.height > acc.height)
return { width: curr.width, height: curr.height, bitrate: curr.bitrate }
if (curr.height > acc.height) {
const bitrate = curr.tags.variant_bitrate ? parseInt(curr.tags.variant_bitrate) : 0
return { width: curr.width, height: curr.height, bitrate }
}
return acc
},
{ width: 0, height: 0, bitrate: 0 }