feat: Adds jellyfin external URL and timeout gh-13

- Adds Jellyfin external URL config option - URL to send to users if
 different from server URL.
 - Adds Jellyfin server setup timeout after 5 seconds, and response
 delaying so discord bot doesn't timeout

task: gh-13
This commit is contained in:
Yoruio
2022-07-16 14:18:04 -06:00
parent 3a4ddbd627
commit 11b42cff53
5 changed files with 39 additions and 13 deletions

View File

@@ -164,12 +164,12 @@ def get_config(jellyfin_url, jellyfin_api_key):
url = f"{jellyfin_url}/System/Configuration"
querystring = {"api_key":jellyfin_api_key}
response = requests.request("GET", url, params=querystring)
response = requests.request("GET", url, params=querystring, timeout=5)
return response.json()
def get_status(jellyfin_url, jellyfin_api_key):
url = f"{jellyfin_url}/System/Configuration"
querystring = {"api_key":jellyfin_api_key}
response = requests.request("GET", url, params=querystring)
response = requests.request("GET", url, params=querystring, timeout=5)
return response.status_code