mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-24 09:46:11 +00:00
Fix flake8 E721
This commit is contained in:
parent
6a99d8ef4b
commit
415fa8ce97
5 changed files with 12 additions and 8 deletions
|
@ -619,7 +619,7 @@ def browse(media, view_id=None, folder=None, server_id=None, api_client=None):
|
|||
|
||||
actions = Actions(server_id, api_client)
|
||||
list_li = []
|
||||
listing = listing if type(listing) == list else listing.get("Items", [])
|
||||
listing = listing if isinstance(listing, list) else listing.get("Items", [])
|
||||
|
||||
for item in listing:
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ LOG = LazyLogger(__name__)
|
|||
|
||||
def translate(string):
|
||||
"""Get add-on string. Returns in unicode."""
|
||||
if type(string) != int:
|
||||
if not isinstance(string, int):
|
||||
string = STRINGS[string]
|
||||
|
||||
result = xbmcaddon.Addon("plugin.video.jellyfin").getLocalizedString(string)
|
||||
|
|
|
@ -26,7 +26,7 @@ def progress(message=None):
|
|||
|
||||
dialog = xbmcgui.DialogProgressBG()
|
||||
|
||||
if item and type(item) == dict:
|
||||
if item and isinstance(item, dict):
|
||||
|
||||
dialog.create(
|
||||
translate("addon_name"),
|
||||
|
@ -74,7 +74,7 @@ def jellyfin_item(func):
|
|||
|
||||
def wrapper(self, item, *args, **kwargs):
|
||||
e_item = self.jellyfin_db.get_item_by_id(
|
||||
item["Id"] if type(item) == dict else item
|
||||
item["Id"] if isinstance(item, dict) else item
|
||||
)
|
||||
|
||||
return func(self, item, e_item=e_item, *args, **kwargs)
|
||||
|
|
|
@ -104,7 +104,7 @@ class Objects(object):
|
|||
if obj_key:
|
||||
obj = (
|
||||
[d[obj_key] for d in obj if d.get(obj_key)]
|
||||
if type(obj) == list
|
||||
if isinstance(obj, list)
|
||||
else obj.get(obj_key)
|
||||
)
|
||||
|
||||
|
|
|
@ -444,7 +444,7 @@ class Views(object):
|
|||
etree.SubElement(xml, "content")
|
||||
|
||||
label = xml.find("label")
|
||||
label.text = str(name) if type(name) == int else name
|
||||
label.text = str(name) if isinstance(name, int) else name
|
||||
|
||||
content = xml.find("content")
|
||||
content.text = view["Media"]
|
||||
|
@ -847,7 +847,9 @@ class Views(object):
|
|||
else:
|
||||
window_path = "ActivateWindow(Videos,%s,return)" % path
|
||||
|
||||
node_label = translate(node_label) if type(node_label) == int else node_label
|
||||
node_label = (
|
||||
translate(node_label) if isinstance(node_label, int) else node_label
|
||||
)
|
||||
node_label = node_label or view["Name"]
|
||||
|
||||
if node in ("all", "music"):
|
||||
|
@ -896,7 +898,9 @@ class Views(object):
|
|||
else:
|
||||
window_path = "ActivateWindow(Videos,%s,return)" % path
|
||||
|
||||
node_label = translate(node_label) if type(node_label) == int else node_label
|
||||
node_label = (
|
||||
translate(node_label) if isinstance(node_label, int) else node_label
|
||||
)
|
||||
node_label = node_label or view["Name"]
|
||||
|
||||
if node == "all":
|
||||
|
|
Loading…
Reference in a new issue