1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
This commit is contained in:
TelepathicWalrus 2023-08-04 18:20:51 +01:00 committed by Bill Thornton
parent eda888ede1
commit 88e925686b
2 changed files with 8 additions and 5 deletions

View file

@ -112,12 +112,15 @@ class HtmlAudioPlayer {
let val = options.url;
console.debug('playing url: ' + val);
import('../../scripts/settings/userSettings').then((userSettings) => {
if (userSettings.udioNormalization() == "TrackGain" && options.item.LUFS != null) {
console.debug(userSettings.selectAudioNormalization());
if (userSettings.selectAudioNormalization() == "TrackGain" && options.item.LUFS != null) {
const dbGain = -18 - options.item.LUFS;
self.gainNode.gain.value = Math.pow(10, (dbGain / 20));
} else if (userSettings.AudioNormalization == "AlbumGain" && options.item.LUFSAlbum != null) {
console.debug("using trackgain")
} else if (userSettings.selectAudioNormalization() == "AlbumGain" && options.item.LUFSAlbum != null) {
const dbGain = -18 - options.item.LUFSAlbum;
self.gainNode.gain.value = Math.pow(10, (dbGain / 20));
console.debug("using albumgain")
} else {
self.gainNode.gain.value = 1;
}

View file

@ -161,12 +161,12 @@ export class UserSettings {
* @param {string|undefined} val - Flag to enable 'Enable Audio Normalization' or undefined.
* @return {string} 'Enable Audio Normalization' state.
*/
audioNormalization(val) {
selectAudioNormalization(val) {
if (val !== undefined) {
return this.set('selectAudioNormalization', val, false);
}
return this.get('selectAudioNormalization', false) || "TrackGain";
return this.get('selectAudioNormalization', false);
}
/**
@ -636,7 +636,7 @@ export const serverConfig = currentSettings.serverConfig.bind(currentSettings);
export const allowedAudioChannels = currentSettings.allowedAudioChannels.bind(currentSettings);
export const preferFmp4HlsContainer = currentSettings.preferFmp4HlsContainer.bind(currentSettings);
export const enableCinemaMode = currentSettings.enableCinemaMode.bind(currentSettings);
export const enableAudioNormalization = currentSettings.enableAudioNormalization.bind(currentSettings);
export const selectAudioNormalization = currentSettings.selectAudioNormalization.bind(currentSettings);
export const enableNextVideoInfoOverlay = currentSettings.enableNextVideoInfoOverlay.bind(currentSettings);
export const enableVideoRemainingTime = currentSettings.enableVideoRemainingTime.bind(currentSettings);
export const enableThemeSongs = currentSettings.enableThemeSongs.bind(currentSettings);