mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-11-10 18:36:33 +00:00
Removed redundant data structure
This commit is contained in:
parent
1df9195a7d
commit
19450bf723
1 changed files with 4 additions and 18 deletions
|
|
@ -104,8 +104,7 @@ class ConnectionManager(object):
|
||||||
'Username': username,
|
'Username': username,
|
||||||
'Pw': password or ""
|
'Pw': password or ""
|
||||||
}
|
}
|
||||||
result = self._REQUEST_URL(url, "POST", json=json, additional_headers=False)
|
result = self.http.REQUEST(url, "POST", json=json, timeout=self.timeout)
|
||||||
|
|
||||||
except Exception as error: # Failed to login
|
except Exception as error: # Failed to login
|
||||||
LOG.exception(error)
|
LOG.exception(error)
|
||||||
return False
|
return False
|
||||||
|
|
@ -184,27 +183,14 @@ class ConnectionManager(object):
|
||||||
def get_jellyfin_url(self, base, handler):
|
def get_jellyfin_url(self, base, handler):
|
||||||
return "%s/%s" % (base, handler)
|
return "%s/%s" % (base, handler)
|
||||||
|
|
||||||
def _REQUEST_URL(self, url, type, data_type=None, timeout=None, verify=None, retry=None,
|
def _REQUEST_URL(self, url, type, data_type=None, timeout=None, verify=None, retry=5,
|
||||||
headers={}, json=None, additional_headers=True):
|
headers={}, json=None, additional_headers=True):
|
||||||
data = {
|
headers = dict(headers)
|
||||||
'type': type,
|
|
||||||
'url': url,
|
|
||||||
'headers': headers,
|
|
||||||
}
|
|
||||||
if verify is not None:
|
|
||||||
data['verify'] = verify
|
|
||||||
if retry is not None:
|
|
||||||
data['retry'] = retry
|
|
||||||
if json is not None:
|
|
||||||
data['json'] = json
|
|
||||||
|
|
||||||
|
|
||||||
timeout = timeout or self.timeout
|
timeout = timeout or self.timeout
|
||||||
data['timeout'] = timeout
|
|
||||||
if additional_headers:
|
if additional_headers:
|
||||||
extra_headers = self._get_headers(data_type)
|
extra_headers = self._get_headers(data_type)
|
||||||
data['headers'].update(extra_headers)
|
headers.update(extra_headers)
|
||||||
headers = data['headers']
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return self.http.REQUEST(url, type, json=json, headers=headers, \
|
return self.http.REQUEST(url, type, json=json, headers=headers, \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue