mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2024-11-22 07:37:29 +00:00
Update "preferred quality" setting
- Re-order the options on the settings page - "best" and "best <= 1080p" now prefer high-fps
This commit is contained in:
parent
05b91a7102
commit
699af63583
16
api/video.js
16
api/video.js
@ -52,15 +52,21 @@ function sortFormats(video, preference) {
|
||||
}
|
||||
|
||||
if (preference === 1) { // best dash
|
||||
formats.sort((a, b) => (b.second__height - a.second__height))
|
||||
formats.sort((a, b) => {
|
||||
const a1 = a.second__height + a.fps / 100
|
||||
const b1 = b.second__height + b.fps / 100
|
||||
return b1 - a1
|
||||
})
|
||||
} else if (preference === 2) { // best <=1080p
|
||||
formats.sort((a, b) => {
|
||||
if (b.second__height > 1080) {
|
||||
if (a.second__height > 1080) return b.second__height - a.second__height
|
||||
const a1 = a.second__height + a.fps / 100
|
||||
const b1 = b.second__height + b.fps / 100
|
||||
if (b1 > 1081) {
|
||||
if (a1 > 1081) return b1 - a1
|
||||
return -1
|
||||
}
|
||||
if (a.second__height > 1080) return 1
|
||||
return b.second__height - a.second__height
|
||||
if (a1 > 1081) return 1
|
||||
return b1 - a1
|
||||
})
|
||||
} else if (preference === 3) { // best low-fps
|
||||
formats.sort((a, b) => {
|
||||
|
@ -34,10 +34,10 @@ block content
|
||||
|
||||
+select("quality", "Preferred qualities", false, [
|
||||
{value: "0", text: "720p"},
|
||||
{value: "4", text: "360p"},
|
||||
{value: "1", text: "Best possible"},
|
||||
{value: "2", text: "Best <=1080p"},
|
||||
{value: "3", text: "Best <=30fps"},
|
||||
{value: "4", text: "360p"}
|
||||
{value: "3", text: "Best <=30fps"}
|
||||
])
|
||||
|
||||
+select("save_history", "Watched videos history", false, [
|
||||
|
Loading…
Reference in New Issue
Block a user