Fix grouped views

Something changed in the emby returned paths so the verification was
failing. For now, we are getting one item from the media folder and
comparing using the user view to make sure we are referring to the
correct one with the tag name. Asked Luke for an api that would do this.
This commit is contained in:
angelblue05 2016-03-01 18:00:19 -06:00
parent e2a117ea97
commit 4cdf5c3c4d
2 changed files with 50 additions and 9 deletions

View file

@ -367,6 +367,32 @@ class Read_EmbyServer():
return views
def verifyView(self, parentid, itemid):
belongs = False
url = "{server}/emby/Users/{UserId}/Items?format=json"
params = {
'ParentId': parentid,
'CollapseBoxSetItems': False,
'IsVirtualUnaired': False,
'IsMissing': False,
'Recursive': True,
'Ids': itemid
}
result = self.doUtils(url, parameters=params)
try:
total = result['TotalRecordCount']
except TypeError:
# Something happened to the connection
pass
else:
if total:
belongs = True
return belongs
def getMovies(self, parentId, basic=False, dialog=None):
items = self.getSection(parentId, "Movie", basic=basic, dialog=dialog)