Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Aug 25, 2024
2 parents 3bbf781 + 9f0048c commit b0ad181
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
7 changes: 7 additions & 0 deletions music_assistant/common/models/config_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,13 @@ class CoreConfig(Config):
"'chunked transfer encoding', works just fine. \n\n",
)

CONF_ENTRY_HTTP_PROFILE_DEFAULT_2 = ConfigEntry.from_dict(
{**CONF_ENTRY_HTTP_PROFILE.to_dict(), "default_value": "no_content_length"}
)
CONF_ENTRY_HTTP_PROFILE_FORCED_2 = ConfigEntry.from_dict(
{**CONF_ENTRY_HTTP_PROFILE.to_dict(), "default_value": "no_content_length", "hidden": True}
)


def create_sample_rates_config_entry(
max_sample_rate: int,
Expand Down
8 changes: 4 additions & 4 deletions music_assistant/server/controllers/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ async def serve_queue_item_stream(self, request: web.Request) -> web.Response:
default_sample_rate=queue_item.streamdetails.audio_format.sample_rate,
default_bit_depth=queue_item.streamdetails.audio_format.bit_depth,
)
http_profile: str = self.mass.config.get_raw_player_config_value(
queue_id, CONF_HTTP_PROFILE, "chunked"
http_profile: str = await self.mass.config.get_player_config_value(
queue_id, CONF_HTTP_PROFILE
)
# prepare request, add some DLNA/UPNP compatible headers
headers = {
Expand Down Expand Up @@ -356,8 +356,8 @@ async def serve_queue_flow_stream(self, request: web.Request) -> web.Response:
icy_meta_interval = 16384

# prepare request, add some DLNA/UPNP compatible headers
http_profile: str = self.mass.config.get_raw_player_config_value(
queue_id, CONF_HTTP_PROFILE, "chunked"
http_profile: str = await self.mass.config.get_player_config_value(
queue_id, CONF_HTTP_PROFILE
)
# prepare request, add some DLNA/UPNP compatible headers
headers = {
Expand Down
2 changes: 2 additions & 0 deletions music_assistant/server/providers/slimproto/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
CONF_ENTRY_EQ_BASS,
CONF_ENTRY_EQ_MID,
CONF_ENTRY_EQ_TREBLE,
CONF_ENTRY_HTTP_PROFILE_FORCED_2,
CONF_ENTRY_OUTPUT_CHANNELS,
CONF_ENTRY_SYNC_ADJUST,
ConfigEntry,
Expand Down Expand Up @@ -317,6 +318,7 @@ async def get_player_config_entries(self, player_id: str) -> tuple[ConfigEntry]:
CONF_ENTRY_SYNC_ADJUST,
CONF_ENTRY_DISPLAY,
CONF_ENTRY_VISUALIZATION,
CONF_ENTRY_HTTP_PROFILE_FORCED_2,
create_sample_rates_config_entry(int(slimclient.max_sample_rate), 24, 48000, 24),
)
)
Expand Down
4 changes: 2 additions & 2 deletions music_assistant/server/providers/ugp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ async def _serve_ugp_stream(self, request: web.Request) -> web.Response:
bit_depth=stream.audio_format.bit_depth,
)

http_profile: str = self.mass.config.get_raw_player_config_value(
child_player_id, CONF_HTTP_PROFILE, "chunked"
http_profile: str = await self.mass.config.get_player_config_value(
child_player_id, CONF_HTTP_PROFILE
)
headers = {
**DEFAULT_STREAM_HEADERS,
Expand Down

0 comments on commit b0ad181

Please sign in to comment.