Fix undefined errors

This commit is contained in:
Matt
2022-02-27 23:36:01 -05:00
parent 36b23d0b19
commit 7eef3a30a8
4 changed files with 6 additions and 2 deletions

View File

@@ -232,6 +232,7 @@ class CacheArtwork(threading.Thread):
if isinstance(results, dict):
results = results.get("Items")
settings = xbmcaddon.Addon()
server = settings.getSetting('server_address')
log.debug("Jellyfin Item Count Count: {0}".format(len(results)))

View File

@@ -196,7 +196,7 @@ def __get_parent_id_from(params):
log.debug("TV show providers IDs: {}".format(show_provider_ids))
get_show_url = "/Users/{}/Items?fields=MediaStreams&Recursive=true" \
"&IncludeItemTypes=series&IncludeMedia=true&ImageTypeLimit=1&Limit=16" \
"&AnyProviderIdEquals={}".format(api.user_id, item_id, show_provider_ids)
"&AnyProviderIdEquals={}".format(api.user_id, show_provider_ids)
content = dataManager.get_content(get_show_url)
show = content.get("Items")
if len(show) == 1:

View File

@@ -33,6 +33,8 @@ def show_server_sessions():
return
list_items = []
settings = xbmcaddon.Addon()
server = settings.getSetting('server_address')
for session in results:
device_name = session.get("DeviceName", "na")
user_name = session.get("UserName", "na")
@@ -57,7 +59,6 @@ def show_server_sessions():
art = {}
if now_playing:
server = settings.getSetting('server_address')
art = get_art(now_playing, server)
runtime = now_playing.get("RunTimeTicks", 0)

View File

@@ -12,6 +12,7 @@ import xbmc
import xbmcaddon
import xbmcgui
from .api import API
from .functions import play_action
from .loghandler import LazyLogger
from .jsonrpc import JsonRpc
@@ -290,6 +291,7 @@ class WebSocketClient(threading.Thread):
def post_capabilities(self):
settings = xbmcaddon.Addon()
user_details = load_user_details()
api = API(