fix discovery when running in docker
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sat, 19 Dec 2020 16:39:48 +0000 (17:39 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Sat, 19 Dec 2020 16:39:48 +0000 (17:39 +0100)
music_assistant/constants.py
music_assistant/web/server.py

index 90721522f0f5fd991a60dcea721ab4d59d5b4d35..33983315ee5358e3ae3ae356033d53ada05c6114 100755 (executable)
@@ -1,6 +1,6 @@
 """All constants for Music Assistant."""
 
-__version__ = "0.0.73"
+__version__ = "0.0.74"
 REQUIRED_PYTHON_VER = "3.7"
 
 # configuration keys/attributes
index 3c335217482be74ddd6c9b790170653fdbebbb69..1d3f7b779f07daef8df8621fcff11a397a85dd99 100755 (executable)
@@ -114,12 +114,15 @@ class WebServer:
             func = getattr(cls, item)
             if not hasattr(func, "ws_cmd_path"):
                 continue
-            # method is decorated with our websocket decorator
+            # method is decorated with our api decorator
             self.register_api_route(func.ws_cmd_path, func)
 
     @property
     def hostname(self):
         """Return the hostname for this Music Assistant instance."""
+        if not self._hostname.endswith(".local"):
+            # probably running in docker ?
+            return "musicassistant.local"
         return self._hostname
 
     @property
@@ -162,7 +165,7 @@ class WebServer:
             "initialized": self.mass.config.stored_config["initialized"],
         }
 
-    @api_route("info")
+    @api_route("info", False)
     async def async_info(self, request: web.Request = None):
         """Return discovery info on index page."""
         if request: