Fixed video nodes

This commit is contained in:
tomkat83 2016-03-03 09:04:15 +01:00
parent c8004d3dbf
commit ccdaaf5b4e
3 changed files with 45 additions and 36 deletions

View file

@ -413,7 +413,7 @@ class LibrarySync(Thread):
nodes = self.nodes[mediatype]
# Prevent duplicate for playlists of the same type
playlists = self.playlists[mediatype]
sorted_views = self.sorted_views[mediatype]
sorted_views = self.sorted_views
folderid = folder['key']
foldername = folder['title']
@ -456,7 +456,6 @@ class LibrarySync(Thread):
# Remove views that are still valid to delete rest later
try:
# View is still valid
self.old_views.remove(folderid)
except ValueError:
# View was just created, nothing to remove
@ -550,9 +549,6 @@ class LibrarySync(Thread):
self.logMsg("Error download PMS views, abort maintainViews", -1)
return False
# total nodes for window properties
vnodes.clearProperties()
totalnodes = 0
# For whatever freaking reason, .copy() or dict() does NOT work?!?!?!
self.nodes = {
'movie': [],
@ -564,16 +560,17 @@ class LibrarySync(Thread):
'show': [],
'artist': []
}
self.sorted_views = {
'movie': [],
'show': [],
'artist': []
}
self.sorted_views = []
for view in sections:
itemType = view.attrib['type']
if itemType in ('movie', 'show'): # and NOT artist for now
self.sorted_views[itemType].append(view.attrib['title'])
self.sorted_views.append(view.attrib['title'])
self.logMsg('Sorted views: %s' % self.sorted_views, 1)
# total nodes for window properties
vnodes.clearProperties()
totalnodes = len(self.sorted_views)
with embydb.GetEmbyDB() as emby_db:
# Backup old views to delete them later, if needed (at the end
@ -585,7 +582,6 @@ class LibrarySync(Thread):
kodi_db,
emby_db,
totalnodes)
else:
# Add video nodes listings
# Plex: there seem to be no favorites/favorites tag
# vnodes.singleNode(totalnodes,
@ -598,11 +594,14 @@ class LibrarySync(Thread):
# "tvshows",
# "favourites")
# totalnodes += 1
vnodes.singleNode(totalnodes,
"channels",
"movies",
"channels")
totalnodes += 1
# vnodes.singleNode(totalnodes,
# "channels",
# "movies",
# "channels")
# totalnodes += 1
with kodidb.GetKodiDB('music') as kodi_db:
pass
# Save total
utils.window('Emby.nodes.total', str(totalnodes))

View file

@ -42,6 +42,16 @@ class VideoNodes(object):
def viewNode(self, indexnumber, tagname, mediatype, viewtype, viewid, delete=False):
# Plex: reassign mediatype due to Kodi inner workings
mediatypes = {
'movie': 'movies',
'show': 'tvshows',
'photo': 'photos',
'homevideo': 'homevideos',
'musicvideos': 'musicvideos'
}
mediatype = mediatypes[mediatype]
window = utils.window
kodiversion = self.kodiversion
@ -116,7 +126,7 @@ class VideoNodes(object):
}
mediatypes = {
# label according to nodetype per mediatype
'movie':
'movies':
{
'1': tagname,
'2': 30174,
@ -128,7 +138,7 @@ class VideoNodes(object):
'11': 30230
},
'show':
'tvshows':
{
'1': tagname,
'2': 30170,
@ -141,14 +151,14 @@ class VideoNodes(object):
'11': 30230
},
'homevideos':
'homevideoss':
{
'1': tagname,
'2': 30251,
'11': 30253
},
'photo':
'photos':
{
'1': tagname,
'2': 30252,

View file

@ -85,7 +85,7 @@
<setting id="logLevel" type="enum" label="30004" values="Disabled|Info|Debug" default="1" />
<setting id="startupDelay" type="number" label="30529" default="0" option="int" />
<setting label="30239" type="action" action="RunPlugin(plugin://plugin.video.plexkodiconnect?mode=reset)" option="close" />
<setting id="syncThreadNumber" type="number" label="Number of parallel threads while syncing" default="10" option="int"/>
<setting id="syncThreadNumber" type="number" label="Number of parallel threads while syncing" default="5" option="int"/>
</category>
<category label="Plex Companion">
<setting id="plexCompanion" label="Enable Plex Companion" type="bool" default="true" />