From f1e01fe0a95035860a1b4427f9bafcc4af127d77 Mon Sep 17 00:00:00 2001 From: xnappo Date: Tue, 17 Mar 2015 10:47:24 -0500 Subject: [PATCH] Get real full nodes for standard collections --- resources/lib/LibrarySync.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/resources/lib/LibrarySync.py b/resources/lib/LibrarySync.py index dd63b515..1d6c4f3f 100644 --- a/resources/lib/LibrarySync.py +++ b/resources/lib/LibrarySync.py @@ -1161,9 +1161,19 @@ class LibrarySync(): views = views.get("Items") collections=[] for view in views: + if view.get("Type") == 'UserView': # Need to grab the real main node + newViewsUrl = server + '/mediabrowser/Users/' + userid + '/items?ParentId=' + view.get("Id") + '&SortBy=SortName&SortOrder=Ascending&format=json&ImageTypeLimit=1' + jsonData = DownloadUtils().downloadUrl(newViewsUrl, suppress=True, popup=0 ) + if(jsonData != ""): + newViews = json.loads(jsonData) + newViews = newViews.get("Items") + for newView in newViews: + # There are multiple nodes in here like 'Latest', 'NextUp' - below we grab the full node. + if newView.get("CollectionType") == "MovieMovies" or newView.get("CollectionType") == "TvShowSeries": + view=newView if(view.get("ChildCount") != 0): Name =(view.get("Name")).encode('utf-8') - + total = str(view.get("ChildCount")) type = view.get("CollectionType") if type == None: