From 899ca43576078a6c6aa5d840090fc6fb63ae6419 Mon Sep 17 00:00:00 2001 From: Eric B Munson Date: Mon, 14 Sep 2026 09:50:27 -0400 Subject: [PATCH] OpenSubsonic: Migrate away from provider specific podcast switch Now that we have a generic sync option for podcasts it is confusing for users to have to set both options. Worse, if the settings disagree it can lead to unexpected behavior or provider sync failures. Deprecate the provider specifid option in favor of the generic sync. Signed-off-by: Eric B Munson --- .../providers/opensubsonic/sonic_provider.py | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/music_assistant/providers/opensubsonic/sonic_provider.py b/music_assistant/providers/opensubsonic/sonic_provider.py index 5fb943313a..74da02b7d9 100644 --- a/music_assistant/providers/opensubsonic/sonic_provider.py +++ b/music_assistant/providers/opensubsonic/sonic_provider.py @@ -5,6 +5,7 @@ from datetime import datetime from typing import TYPE_CHECKING, Any, ParamSpec, TypeVar +from aiohttp import ClientResponseError from libopensonic import AsyncConnection as SonicConnection from libopensonic import Extensions as OpenSubsonicExtensions from libopensonic.errors import ( @@ -122,6 +123,7 @@ async def get_config_entries(self) -> tuple[ConfigEntry, ...]: key=CONF_ENABLE_PODCASTS, type=ConfigEntryType.BOOLEAN, required=True, + hidden=True, default_value=True, ), ConfigEntry( @@ -242,7 +244,23 @@ async def handle_async_init(self) -> None: except OSError: self.logger.info("Failed to query server for OpenSubsonic extensions") - self._enable_podcasts = bool(self.config.get_value(CONF_ENABLE_PODCASTS)) + # Migration from the old subsonic config for enabling podcasts + the generic library sync option + # to a only using the library sync (plus probing a podcast endpoint) + # After this code has gone out in a release which marks the podcast option + # as not visible, we will drop that config option entirely and set + # _enable_podcasts to the result of the probe + + can_podcast = False + if bool(self.config.get_value("library_sync_podcasts")): + try: + await self.conn.get_podcasts(inc_episodes=False) + can_podcast = True + except SonicError: + self.logger.info("Server does not support podcasts, disabling") + except ClientResponseError: + self.logger.info("Server does not support podcasts, disabling") + + self._enable_podcasts = bool(self.config.get_value(CONF_ENABLE_PODCASTS)) and can_podcast self._enable_radio_stations = bool(self.config.get_value(CONF_ENABLE_RADIO_STATIONS)) self._show_faves = bool(self.config.get_value(CONF_RECO_FAVES)) self._show_new = bool(self.config.get_value(CONF_NEW_ALBUMS))