From: Marcel van der Veldt Date: Sun, 26 Oct 2025 03:01:05 +0000 (+0100) Subject: fix small oversight in CONF_ALLOW_BUFFER_DEFAULT X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=2b338c849f2c185619f1ff87d053dc81babe858c;p=music-assistant-server.git fix small oversight in CONF_ALLOW_BUFFER_DEFAULT --- diff --git a/music_assistant/controllers/streams.py b/music_assistant/controllers/streams.py index b3dbdbb1..ae4988ba 100644 --- a/music_assistant/controllers/streams.py +++ b/music_assistant/controllers/streams.py @@ -97,6 +97,7 @@ CONF_ALLOW_CROSSFADE_SAME_ALBUM: Final[str] = "allow_crossfade_same_album" # Calculate total system memory once at module load time TOTAL_SYSTEM_MEMORY_GB: Final[float] = get_total_system_memory() +CONF_ALLOW_BUFFER_DEFAULT = TOTAL_SYSTEM_MEMORY_GB >= 8.0 def parse_pcm_info(content_type: str) -> tuple[int, int, int]: @@ -184,7 +185,7 @@ class StreamsController(CoreController): ConfigEntry( key=CONF_ALLOW_BUFFER, type=ConfigEntryType.BOOLEAN, - default_value=TOTAL_SYSTEM_MEMORY_GB >= 8.0, + default_value=CONF_ALLOW_BUFFER_DEFAULT, label="Allow (in-memory) buffering of (track) audio", description="By default, Music Assistant tries to be as resource " "efficient as possible when streaming audio, especially considering " @@ -1127,7 +1128,9 @@ class StreamsController(CoreController): streamdetails.volume_normalization_gain_correct = gain_correct allow_buffer = bool( - self.mass.config.get_raw_core_config_value(self.domain, CONF_ALLOW_BUFFER, False) + self.mass.config.get_raw_core_config_value( + self.domain, CONF_ALLOW_BUFFER, CONF_ALLOW_BUFFER_DEFAULT + ) and streamdetails.duration )