From 2f3d9c4a60bff15a7a102f57de18dc4aa2ad7913 Mon Sep 17 00:00:00 2001
From: angelblue05 <tamara.angel05@gmail.com>
Date: Fri, 19 Feb 2016 17:34:22 -0600
Subject: [PATCH] Fix views

Alright get rid of the duplicate in the add-on entrypoint
---
 resources/lib/entrypoint.py  | 5 +++++
 resources/lib/librarysync.py | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py
index c30a2384..5fb846eb 100644
--- a/resources/lib/entrypoint.py
+++ b/resources/lib/entrypoint.py
@@ -60,6 +60,7 @@ def doMainListing():
     xbmcplugin.setContent(int(sys.argv[1]), 'files')    
     # Get emby nodes from the window props
     embyprops = utils.window('Emby.nodes.total')
+    nodes = []
     if embyprops:
         totalnodes = int(embyprops)
         for i in range(totalnodes):
@@ -68,6 +69,10 @@ def doMainListing():
                 path = utils.window('Emby.nodes.%s.content' % i)
             label = utils.window('Emby.nodes.%s.title' % i)
             type = utils.window('Emby.nodes.%s.type' % i)
+            if label not in nodes:
+                nodes.append(label)
+            else: # Avoid duplicates
+                continue
             #because we do not use seperate entrypoints for each content type, we need to figure out which items to show in each listing.
             #for now we just only show picture nodes in the picture library video nodes in the video library and all nodes in any other window
             if path and xbmc.getCondVisibility("Window.IsActive(Pictures)") and type == "photos":
diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py
index 26945da6..a2b65167 100644
--- a/resources/lib/librarysync.py
+++ b/resources/lib/librarysync.py
@@ -402,7 +402,7 @@ class LibrarySync(threading.Thread):
                         # This is only reserved for the detection of grouped views
                         if (grouped_view['Type'] == "UserView" and 
                             grouped_view.get('CollectionType') == mediatype and
-                            grouped_view['Id'] not in grouped_view.get('Path', "")):
+                            grouped_view['Id'] in grouped_view.get('Path', "")):
                             # Take the name of the userview
                             foldername = grouped_view['Name']
                             break