Subsonic: Implement features required by Nextcloud Music support (#1056)
authorperillamint <perillamint@users.noreply.github.com>
Fri, 9 Feb 2024 08:45:32 +0000 (17:45 +0900)
committerGitHub <noreply@github.com>
Fri, 9 Feb 2024 08:45:32 +0000 (09:45 +0100)
music_assistant/server/providers/opensubsonic/__init__.py
music_assistant/server/providers/opensubsonic/sonic_provider.py

index b0349f135830ac4c4361b67826ffccce577f264d..89226a195baf28c592e740e29b6c3c3fa4640e58 100644 (file)
@@ -12,7 +12,12 @@ from music_assistant.common.models.config_entries import (
 from music_assistant.common.models.enums import ConfigEntryType
 from music_assistant.constants import CONF_PASSWORD, CONF_PATH, CONF_PORT, CONF_USERNAME
 
-from .sonic_provider import CONF_BASE_URL, CONF_ENABLE_PODCASTS, OpenSonicProvider
+from .sonic_provider import (
+    CONF_BASE_URL,
+    CONF_ENABLE_LEGACY_AUTH,
+    CONF_ENABLE_PODCASTS,
+    OpenSonicProvider,
+)
 
 if TYPE_CHECKING:
     from music_assistant.common.models.provider import ProviderManifest
@@ -81,4 +86,12 @@ async def get_config_entries(
             description="Should the provider query for podcasts as well as music?",
             default_value=True,
         ),
+        ConfigEntry(
+            key=CONF_ENABLE_LEGACY_AUTH,
+            type=ConfigEntryType.BOOLEAN,
+            label="Enable legacy auth",
+            required=True,
+            description='Enable OpenSubsonic "legacy" auth support',
+            default_value=False,
+        ),
     )
index c40d19209de0ec8bad57273ae7c33ca1f31b13a1..05dfa34c54311fb6e32d402380c141012a1b2bfb 100644 (file)
@@ -54,6 +54,7 @@ if TYPE_CHECKING:
 
 CONF_BASE_URL = "baseURL"
 CONF_ENABLE_PODCASTS = "enable_podcasts"
+CONF_ENABLE_LEGACY_AUTH = "enable_legacy_auth"
 
 UNKNOWN_ARTIST_ID = "fake_artist_unknown"
 
@@ -76,6 +77,7 @@ class OpenSonicProvider(MusicProvider):
             self.config.get_value(CONF_BASE_URL),
             username=self.config.get_value(CONF_USERNAME),
             password=self.config.get_value(CONF_PASSWORD),
+            legacyAuth=self.config.get_value(CONF_ENABLE_LEGACY_AUTH),
             port=port,
             serverPath=path,
             appName="Music Assistant",