mirror of
https://github.com/wukko/cobalt.git
synced 2025-03-05 00:18:52 +01:00
fix(threads): small fix to quality selection
This commit is contained in:
parent
e16dff3c84
commit
64d9f29209
1 changed files with 1 additions and 1 deletions
|
@ -55,7 +55,7 @@ export default async function({ user, id, quality, dispatcher }) {
|
|||
}
|
||||
|
||||
// types: 640p = 101, 480p = 102, 480p-low = 103
|
||||
const selectedQualityType = quality === 'max' ? 101 : parseInt(quality) > 480 ? 102 : 101;
|
||||
const selectedQualityType = quality === 'max' ? 101 : quality && parseInt(quality) <= 480 ? 102 : 101;
|
||||
const video = post.video_versions.find((v) => v.type === selectedQualityType) || post.video_versions.sort((a, b) => a.type - b.type)[0];
|
||||
if (!video) {
|
||||
return { error: 'ErrorEmptyDownload' };
|
||||
|
|
Loading…
Reference in a new issue