Ensure server is present in API requests

This commit is contained in:
Matt 2022-05-28 10:06:29 -04:00
parent 11705d46f2
commit 7c39b06297

View File

@ -27,6 +27,11 @@ class API:
if 'x-mediabrowser-token' not in self.headers:
self.create_headers()
# Fixes initial login where class is initialized before wizard completes
if not self.server:
self.settings = xbmcaddon.Addon()
self.server = self.settings.getSetting('server_address')
url = '{}{}'.format(self.server, path)
r = requests.get(url, headers=self.headers, verify=self.verify_cert)