File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -403,9 +403,17 @@ async def get_stream_details(
403403 streamdetails .prefer_album_loudness = prefer_album_loudness
404404 player_settings = await mass .config .get_player_config (streamdetails .queue_id )
405405 core_config = await mass .config .get_core_config ("streams" )
406- streamdetails . target_loudness = float (
407- str (player_settings .get_value (CONF_VOLUME_NORMALIZATION_TARGET ))
406+ conf_volume_normalization_target = float (
407+ str (player_settings .get_value (CONF_VOLUME_NORMALIZATION_TARGET , - 17 ))
408408 )
409+ if conf_volume_normalization_target < - 30 or conf_volume_normalization_target >= 0 :
410+ conf_volume_normalization_target = - 17.0 # reset to default if out of bounds
411+ LOGGER .warning (
412+ "Invalid volume normalization target configured for player %s, "
413+ "resetting to default of -17.0 dB" ,
414+ streamdetails .queue_id ,
415+ )
416+ streamdetails .target_loudness = conf_volume_normalization_target
409417 streamdetails .volume_normalization_mode = _get_normalization_mode (
410418 core_config , player_settings , streamdetails
411419 )
You can’t perform that action at this time.
0 commit comments