1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add albumLUFS to mediaSource to prevent new DTO

This commit is contained in:
TelepathicWalrus 2023-08-11 21:09:09 +01:00 committed by Bill Thornton
parent 01dc72924a
commit 28558ce6e4
2 changed files with 6 additions and 3 deletions

View file

@ -2723,7 +2723,10 @@ class PlaybackManager {
}); });
}); });
} else { } else {
return mediaSource; return apiClient.getItem(apiClient.getCurrentUserId(), item.AlbumId).then(function(result) {
mediaSource.albumLUFS = result.LUFS;
return mediaSource;
});
} }
} else { } else {
showPlaybackInfoErrorMessage(self, 'PlaybackErrorNoCompatibleStream'); showPlaybackInfoErrorMessage(self, 'PlaybackErrorNoCompatibleStream');

View file

@ -116,8 +116,8 @@ class HtmlAudioPlayer {
const dbGain = -18 - options.item.LUFS; const dbGain = -18 - options.item.LUFS;
self.gainNode.gain.value = Math.pow(10, (dbGain / 20)); self.gainNode.gain.value = Math.pow(10, (dbGain / 20));
console.debug('Using track gain'); console.debug('Using track gain');
} else if (userSettings.selectAudioNormalization() == 'AlbumGain' && options.item.LUFSAlbum != null) { } else if (userSettings.selectAudioNormalization() == 'AlbumGain' && options.mediaSource.albumLUFS != null) {
const dbGain = -18 - options.item.LUFSAlbum; const dbGain = -18 - options.mediaSource.albumLUFS;
self.gainNode.gain.value = Math.pow(10, (dbGain / 20)); self.gainNode.gain.value = Math.pow(10, (dbGain / 20));
console.debug('Using album gain'); console.debug('Using album gain');
} else { } else {