CONF_LOG_LEVEL,
CONF_OUTPUT_CHANNELS,
CONF_OUTPUT_CODEC,
- CONF_VOLUME_NORMALISATION,
- CONF_VOLUME_NORMALISATION_TARGET,
+ CONF_VOLUME_NORMALIZATION,
+ CONF_VOLUME_NORMALIZATION_TARGET,
SECURE_STRING_SUBSTITUTE,
)
if expected_type == int and isinstance(value, float):
self.value = int(value)
return self.value
- if expected_type == int and isinstance(value, str) and value.isnumeric():
- self.value = int(value)
- return self.value
- if expected_type == float and isinstance(value, str) and value.isnumeric():
- self.value = float(value)
- return self.value
+ for val_type in (int, float):
+ # convert int/float from string
+ if expected_type == val_type and isinstance(value, str):
+ try:
+ self.value = val_type(value)
+ return self.value
+ except ValueError:
+ pass
if self.type in UI_ONLY:
self.value = self.default_value
return self.value
advanced=True,
)
-CONF_ENTRY_VOLUME_NORMALISATION = ConfigEntry(
- key=CONF_VOLUME_NORMALISATION,
+CONF_ENTRY_VOLUME_NORMALIZATION = ConfigEntry(
+ key=CONF_VOLUME_NORMALIZATION,
type=ConfigEntryType.BOOLEAN,
label="Enable volume normalization (EBU-R128 based)",
default_value=True,
"standard without affecting dynamic range",
)
-CONF_ENTRY_VOLUME_NORMALISATION_TARGET = ConfigEntry(
- key=CONF_VOLUME_NORMALISATION_TARGET,
+CONF_ENTRY_VOLUME_NORMALIZATION_TARGET = ConfigEntry(
+ key=CONF_VOLUME_NORMALIZATION_TARGET,
type=ConfigEntryType.INTEGER,
range=(-30, 0),
default_value=-14,
- label="Target level for volume normalisation",
+ label="Target level for volume normalization",
description="Adjust average (perceived) loudness to this target level, " "default is -14 LUFS",
- depends_on=CONF_VOLUME_NORMALISATION,
+ depends_on=CONF_VOLUME_NORMALIZATION,
advanced=True,
)
)
DEFAULT_PLAYER_CONFIG_ENTRIES = (
- CONF_ENTRY_VOLUME_NORMALISATION,
+ CONF_ENTRY_VOLUME_NORMALIZATION,
CONF_ENTRY_FLOW_MODE,
- CONF_ENTRY_VOLUME_NORMALISATION_TARGET,
+ CONF_ENTRY_VOLUME_NORMALIZATION_TARGET,
CONF_ENTRY_EQ_BASS,
CONF_ENTRY_EQ_MID,
CONF_ENTRY_EQ_TREBLE,
CONF_PATH: Final[str] = "path"
CONF_USERNAME: Final[str] = "username"
CONF_PASSWORD: Final[str] = "password"
-CONF_VOLUME_NORMALISATION: Final[str] = "volume_normalisation"
-CONF_VOLUME_NORMALISATION_TARGET: Final[str] = "volume_normalisation_target"
+CONF_VOLUME_NORMALIZATION: Final[str] = "volume_normalization"
+CONF_VOLUME_NORMALIZATION_TARGET: Final[str] = "volume_normalization_target"
CONF_MAX_SAMPLE_RATE: Final[str] = "max_sample_rate"
CONF_EQ_BASS: Final[str] = "eq_bass"
CONF_EQ_MID: Final[str] = "eq_mid"
# track is already played for > 90% - skip to next
resume_item = next_item
resume_pos = 0
- elif queue.current_index is not None and len(queue_items) > 0:
+ elif not resume_item and queue.current_index is not None and len(queue_items) > 0:
resume_item = self.get_item(queue_id, queue.current_index)
resume_pos = 0
- elif queue.current_index is None and len(queue_items) > 0:
+ elif not resume_item and queue.current_index is None and len(queue_items) > 0:
# items available in queue but no previous track, start at 0
resume_item = self.get_item(queue_id, 0)
resume_pos = 0
from music_assistant.common.models.errors import AudioError, MediaNotFoundError, MusicAssistantError
from music_assistant.common.models.media_items import ContentType, MediaType, StreamDetails
from music_assistant.constants import (
- CONF_VOLUME_NORMALISATION,
- CONF_VOLUME_NORMALISATION_TARGET,
+ CONF_VOLUME_NORMALIZATION,
+ CONF_VOLUME_NORMALIZATION_TARGET,
ROOT_LOGGER_NAME,
)
from music_assistant.server.helpers.process import AsyncProcess, check_output
) -> tuple[float | None, float | None]:
"""Get gain correction for given queue / track combination."""
player_settings = mass.config.get_player_config(streamdetails.queue_id)
- if not player_settings or not player_settings.get_value(CONF_VOLUME_NORMALISATION):
+ if not player_settings or not player_settings.get_value(CONF_VOLUME_NORMALIZATION):
return (None, None)
if streamdetails.gain_correct is not None:
return (streamdetails.loudness, streamdetails.gain_correct)
- target_gain = player_settings.get_value(CONF_VOLUME_NORMALISATION_TARGET)
+ target_gain = player_settings.get_value(CONF_VOLUME_NORMALIZATION_TARGET)
track_loudness = await mass.music.get_track_loudness(
streamdetails.item_id, streamdetails.provider
)
try:
self._discovery_running = True
self.logger.debug("Sonos discovery started...")
- discovered_devices: set[soco.SoCo] = await asyncio.to_thread(
- soco.discover, 30, allow_network_scan=True
- )
+ discovered_devices: set[soco.SoCo] = await asyncio.to_thread(soco.discover, 60)
if discovered_devices is None:
discovered_devices = set()
new_device_ids = {item.uid for item in discovered_devices}
"python-slugify==8.0.1",
"mashumaro==3.7",
"memory-tempfile==2.2.3",
- "music-assistant-frontend==20230420.0",
+ "music-assistant-frontend==20230510.0",
"pillow==9.5.0",
"unidecode==1.3.6",
"xmltodict==0.13.0",
git+https://github.com/pytube/pytube.git@refs/pull/1501/head
mashumaro==3.7
memory-tempfile==2.2.3
-music-assistant-frontend==20230420.0
+music-assistant-frontend==20230510.0
orjson==3.8.12
pillow==9.5.0
plexapi==4.13.4