Apply suggestions from code review

This commit is contained in:
Odd Stråbø 2021-10-10 15:05:22 +02:00
parent f6eeb49bd1
commit 1462e07fa5
4 changed files with 8 additions and 4 deletions

View file

@ -35,7 +35,9 @@ class ContextMenu(xbmcgui.WindowXMLDialog):
xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
def set_options(self, options=None):
self._options = [] if options is None else options
self._options = options
if options is None:
self._options = []
def is_selected(self):
return bool(self.selected_option)

View file

@ -267,7 +267,7 @@ def browse(media, view_id=None, folder=None, server_id=None, api_client=None):
monitor = xbmc.Monitor()
for _ in range(300):
for _i in range(300):
if window('jellyfin_online.bool'):
break
elif monitor.waitForAbort(0.1):

View file

@ -51,7 +51,9 @@ class LogHandler(logging.StreamHandler):
self.mask_info = settings('maskInfo.bool')
self.level = xbmc.LOGINFO if kodi_version() > 18 else xbmc.LOGNOTICE
self.level = xbmc.LOGNOTICE
if kodi_version() > 18:
self.level = xbmc.LOGINFO
def emit(self, record):

View file

@ -62,7 +62,7 @@ class WSClient(threading.Thread):
self.wsc.run_forever(ping_interval=10)
if monitor.waitForAbort(5):
if not self.stop and monitor.waitForAbort(5):
break
LOG.info("---<[ websocket ]")