add come verification to values passed into functions and returned from download calls

dont log profile change exception
bump ver
This commit is contained in:
shaun 2016-11-19 10:08:36 +11:00
parent ec28018c61
commit 62c284fdd7
5 changed files with 14 additions and 4 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.emby"
name="Emby"
version="2.3.18"
version="2.3.19"
provider-name="Emby.media">
<requires>
<import addon="xbmc.python" version="2.19.0"/>

View file

@ -144,6 +144,9 @@ class ConnectionManager(object):
def _updateServerInfo(self, server, systemInfo):
if server is None or systemInfo is None:
return
server['Name'] = systemInfo['ServerName']
server['Id'] = systemInfo['Id']

View file

@ -58,7 +58,10 @@ class Embydb_Functions():
def getView_embyId(self, item_id):
# Returns ancestors using embyId
url = "{server}/emby/Items/%s/Ancestors?UserId={UserId}&format=json" % item_id
for view in self.download(url):
view_list = self.download(url)
if view_list is None:
view_list = []
for view in view_list:
if view['Type'] == "CollectionFolder":
# Found view

View file

@ -22,6 +22,7 @@ from views import VideoNodes
from utils import window, settings, dialog, language as lang
from ga_client import GoogleAnalytics
import hashlib
import internal_exceptions
#################################################################################################
@ -106,7 +107,7 @@ class Service(object):
# Profile change happened, terminate this thread and others
log.info("Kodi profile was: %s and changed to: %s. Terminating old Emby thread.",
kodi_profile, window('emby_kodiProfile'))
raise RuntimeError("Kodi profile changed detected")
raise internal_exceptions.ExceptionWrapper("Kodi profile changed detected")
# Before proceeding, need to make sure:
# 1. Server is online

View file

@ -54,7 +54,10 @@ class Views(object):
def _populate_views(self):
# Will get emby views and views in Kodi
grouped_views = self.emby.get_views()
self.grouped_views = grouped_views['Items'] if "Items" in grouped_views else []
if grouped_views is not None and "Items" in grouped_views:
self.grouped_views = grouped_views['Items']
else:
self.grouped_views = []
for view in self.emby.getViews(sortedlist=True):
self.views.append(view['name'])