Fix getting Stream metadata

This commit is contained in:
tomkat83 2015-12-31 12:46:41 +01:00
parent 927c8bf36f
commit 681e57b350
2 changed files with 4 additions and 10 deletions

View file

@ -1788,15 +1788,11 @@ class API():
# TODO: what if several Media tags exist?!?
# Loop over parts
for child in item[0][0]:
part = child.attrib
container = part['container'].lower()
container = child.attrib['container'].lower()
# Loop over Streams
for grandchild in child:
mediaStream = grandchild.attrib
try:
type = mediaStream['streamType']
except KeyError:
type = None
type = int(mediaStream['streamType'])
if type == 1: # Video streams
videotrack = {}
videotrack['videocodec'] = mediaStream['codec'].lower()
@ -1841,11 +1837,12 @@ class API():
subtitlelanguages.append(mediaStream['language'])
except:
subtitlelanguages.append("Unknown")
return {
media = {
'video': videotracks,
'audio': audiotracks,
'subtitle': subtitlelanguages
}
return media
def getAllArtwork(self, parentInfo=False):

View file

@ -472,7 +472,6 @@ class LibrarySync(threading.Thread):
movies = itemtypes.Movies(embycursor, kodicursor)
views = plx.GetPlexCollections('movie')
self.logMsg("Movie folders found: %s" % views, 1)
if compare:
# Pull the list of movies and boxsets in Kodi
@ -480,7 +479,6 @@ class LibrarySync(threading.Thread):
all_kodimoviesId = dict(emby_db.getChecksum('Movie'))
except ValueError:
all_kodimoviesId = {}
self.logMsg("all_kodimoviesId: %s " % (all_kodimoviesId), 1)
all_plexmoviesIds = []
##### PROCESS MOVIES #####
@ -525,7 +523,6 @@ class LibrarySync(threading.Thread):
plex_checksum = API.getChecksum()
all_plexmoviesIds.append(plex_checksum)
updatelist.append(itemid)
self.logMsg("Movies to update for %s: %s" % (viewName, updatelist), 1)
total = len(updatelist)
if pdialog: