Video nodes finally working

This commit is contained in:
tomkat83 2016-01-11 15:56:56 +01:00
parent 21fed2dc63
commit 3b2176574a
2 changed files with 22 additions and 23 deletions

View file

@ -310,11 +310,10 @@ class Movies(Items):
kodicursor.execute("select coalesce(max(idMovie),0) from movie") kodicursor.execute("select coalesce(max(idMovie),0) from movie")
movieid = kodicursor.fetchone()[0] + 1 movieid = kodicursor.fetchone()[0] + 1
if not viewtag or not viewid:
# if not viewtag or not viewid: # Get view tag from emby
# # Get view tag from emby viewtag, viewid, mediatype = self.emby.getView_embyId(itemid)
# viewtag, viewid, mediatype = self.emby.getView_embyId(itemid) self.logMsg("View tag found: %s" % viewtag, 2)
# self.logMsg("View tag found: %s" % viewtag, 2)
# fileId information # fileId information
checksum = API.getChecksum() checksum = API.getChecksum()
@ -472,13 +471,13 @@ class Movies(Items):
# Process studios # Process studios
kodi_db.addStudios(movieid, studios, "movie") kodi_db.addStudios(movieid, studios, "movie")
# Process tags: view, emby tags # Process tags: view, emby tags
# tags = [viewtag] tags = [viewtag]
# tags.extend(item['Tags']) # tags.extend(item['Tags'])
# if userdata['Favorite']: # if userdata['Favorite']:
# tags.append("Favorite movies") # tags.append("Favorite movies")
# kodi_db.addTags(movieid, tags, "movie") kodi_db.addTags(movieid, tags, "movie")
# Process playstates # Process playstates
# resume = API.adjustResume(userdata['Resume']) resume = API.adjustResume(userdata['Resume'])
kodi_db.addPlaystate(fileid, resume, runtime, playcount, dateplayed) kodi_db.addPlaystate(fileid, resume, runtime, playcount, dateplayed)
def updateUserdata(self, item): def updateUserdata(self, item):
@ -1191,10 +1190,7 @@ class TVShows(Items):
update_item = False update_item = False
self.logMsg("showid: %s not found." % itemid, 2) self.logMsg("showid: %s not found." % itemid, 2)
# if viewtag is None or viewid is None: self.logMsg("View tag found: %s" % viewtag, 2)
# # Get view tag from emby
# viewtag, viewid, mediatype = emby.getView_embyId(itemid)
# self.logMsg("View tag found: %s" % viewtag, 2)
# fileId information # fileId information
checksum = API.getChecksum() checksum = API.getChecksum()
@ -1326,12 +1322,8 @@ class TVShows(Items):
# Process studios # Process studios
kodi_db.addStudios(showid, studios, "tvshow") kodi_db.addStudios(showid, studios, "tvshow")
# Process tags: view, emby tags # Process tags: view, emby tags
# tags = [viewtag] tags = [viewtag]
# tags.extend(item['Tags']) kodi_db.addTags(showid, tags, "tvshow")
# if userdata['Favorite']:
# tags.append("Favorite tvshows")
# kodi_db.addTags(showid, tags, "tvshow")
# Process seasons
def refreshSeasonEntry(self, item, showid): def refreshSeasonEntry(self, item, showid):
API = PlexAPI.API(item) API = PlexAPI.API(item)

View file

@ -56,6 +56,13 @@ class VideoNodes(object):
kodiversion = self.kodiversion kodiversion = self.kodiversion
# mediatype conversion
# LEFT: Plex wording, right: Kodi wording
mediaTypeConversion = {
'movie': 'movies',
'show': 'tvshows'
}
mediatype = mediaTypeConversion[mediatype]
if mediatype == "homevideos": if mediatype == "homevideos":
# Treat homevideos as movies # Treat homevideos as movies
mediatype = "movies" mediatype = "movies"
@ -68,7 +75,7 @@ class VideoNodes(object):
path = xbmc.translatePath("special://profile/library/video/").decode('utf-8') path = xbmc.translatePath("special://profile/library/video/").decode('utf-8')
nodepath = xbmc.translatePath( nodepath = xbmc.translatePath(
"special://profile/library/video/plex-%s/" % dirname).decode('utf-8') "special://profile/library/video/plex%s/" % dirname).decode('utf-8')
# Verify the video directory # Verify the video directory
if not xbmcvfs.exists(path): if not xbmcvfs.exists(path):
@ -93,7 +100,7 @@ class VideoNodes(object):
# Create index entry # Create index entry
nodeXML = "%sindex.xml" % nodepath nodeXML = "%sindex.xml" % nodepath
# Set windows property # Set windows property
path = "library://video/plex-%s/" % dirname path = "library://video/plex%s/" % dirname
for i in range(1, indexnumber): for i in range(1, indexnumber):
# Verify to make sure we don't create duplicates # Verify to make sure we don't create duplicates
if utils.window('Emby.nodes.%s.index' % i) == path: if utils.window('Emby.nodes.%s.index' % i) == path:
@ -124,7 +131,7 @@ class VideoNodes(object):
} }
mediatypes = { mediatypes = {
# label according to nodetype per mediatype # label according to nodetype per mediatype
'movie': { 'movies': {
'1': tagname, '1': tagname,
'2': 30174, '2': 30174,
'4': 30177, '4': 30177,
@ -134,7 +141,7 @@ class VideoNodes(object):
'10': 30229, '10': 30229,
'11': 30230}, '11': 30230},
'show': { 'tvshows': {
'1': tagname, '1': tagname,
'2': 30170, '2': 30170,
'3': 30175, '3': 30175,