mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 11:18:28 +00:00
rutube: video quality fallback bugfix
This commit is contained in:
parent
1d5fa62271
commit
be6bd893c7
@ -52,6 +52,12 @@ export default async function(obj) {
|
||||
bestQuality = m3u8.find((i) => (Number(quality) === i.resolution.height));
|
||||
}
|
||||
|
||||
if(bestQuality == null) {
|
||||
bestQuality = m3u8.reduce((prev, curr) => {
|
||||
return Math.abs(Number(curr.resolution.height) - Number(quality)) < Math.abs(Number(prev.resolution.height) - Number(quality)) ? curr : prev;
|
||||
});
|
||||
}
|
||||
|
||||
const fileMetadata = {
|
||||
title: cleanString(play.title.trim()),
|
||||
artist: cleanString(play.author.name.trim()),
|
||||
|
Loading…
Reference in New Issue
Block a user