Re-label Audio Formats

This commit is contained in:
Preston 2020-10-04 21:20:30 -04:00
parent f1b5e67c7c
commit ac9efa8df4
3 changed files with 29 additions and 5 deletions

View File

@ -237,6 +237,11 @@ export default Vue.extend({
return '' return ''
} }
if (this.sourceList[this.sourceList.length - 1].qualityLabel === this.$t('Video.Audio.Low')) {
this.selectedDefaultQuality = this.sourceList[0].qualityLabel
return
}
let defaultQuality = this.defaultQuality let defaultQuality = this.defaultQuality
if (defaultQuality === 'auto') { if (defaultQuality === 'auto') {

View File

@ -319,16 +319,30 @@ export default Vue.extend({
this.audioSourceList = result.player_response.streamingData.adaptiveFormats.filter((format) => { this.audioSourceList = result.player_response.streamingData.adaptiveFormats.filter((format) => {
return format.mimeType.includes('audio') return format.mimeType.includes('audio')
}).map((format) => { }).sort((a, b) => {
return a.bitrate - b.bitrate
}).map((format, index) => {
const label = (x) => {
switch (x) {
case 0:
return this.$t('Video.Audio.Low')
case 1:
return this.$t('Video.Audio.Medium')
case 2:
return this.$t('Video.Audio.High')
case 3:
return this.$t('Video.Audio.Best')
default:
return format.bitrate
}
}
return { return {
url: format.url, url: format.url,
type: format.mimeType, type: format.mimeType,
label: 'Audio', label: 'Audio',
qualityLabel: format.bitrate qualityLabel: label(index)
} }
}).sort((a, b) => { }).reverse()
return a.qualityLabel - b.qualityLabel
})
if (this.activeFormat === 'audio') { if (this.activeFormat === 'audio') {
this.activeSourceList = this.audioSourceList this.activeSourceList = this.audioSourceList

View File

@ -393,6 +393,11 @@ Video:
'Live Chat is currently not supported with the Invidious API. A direct connection to YouTube is required.': Live 'Live Chat is currently not supported with the Invidious API. A direct connection to YouTube is required.': Live
Chat is currently not supported with the Invidious API. A direct connection to Chat is currently not supported with the Invidious API. A direct connection to
YouTube is required. YouTube is required.
Audio:
Low: Low
Medium: Medium
High: High
Best: Best
Published: Published:
Jan: Jan Jan: Jan
Feb: Feb Feb: Feb