More merge conflicts

This commit is contained in:
tomkat83 2016-03-01 12:10:09 +01:00
parent 954e78db55
commit a2251a3482

View file

@ -410,8 +410,7 @@ class LibrarySync(Thread):
folder = folderItem.attrib folder = folderItem.attrib
mediatype = folder['type'] mediatype = folder['type']
# Only process supported formats # Only process supported formats
supportedMedia = ['movie', 'show'] if mediatype not in ('movie', 'show'):
if mediatype not in supportedMedia:
return return
folderid = folder['key'] folderid = folder['key']
@ -437,7 +436,8 @@ class LibrarySync(Thread):
vnodes.viewNode(totalnodes, vnodes.viewNode(totalnodes,
foldername, foldername,
mediatype, mediatype,
viewtype) viewtype,
folderid)
totalnodes += 1 totalnodes += 1
# Add view to emby database # Add view to emby database
emby_db.addView(folderid, foldername, viewtype, tagid) emby_db.addView(folderid, foldername, viewtype, tagid)
@ -480,6 +480,7 @@ class LibrarySync(Thread):
current_viewname, current_viewname,
mediatype, mediatype,
current_viewtype, current_viewtype,
folderid,
delete=True) delete=True)
# Added new playlist # Added new playlist
if mediatype in ['movies', 'tvshows', 'musicvideos']: if mediatype in ['movies', 'tvshows', 'musicvideos']:
@ -489,7 +490,8 @@ class LibrarySync(Thread):
vnodes.viewNode(totalnodes, vnodes.viewNode(totalnodes,
foldername, foldername,
mediatype, mediatype,
viewtype) viewtype,
folderid)
totalnodes += 1 totalnodes += 1
# Update items with new tag # Update items with new tag
@ -510,7 +512,8 @@ class LibrarySync(Thread):
vnodes.viewNode(totalnodes, vnodes.viewNode(totalnodes,
foldername, foldername,
mediatype, mediatype,
viewtype) viewtype,
folderid)
totalnodes += 1 totalnodes += 1
def maintainViews(self): def maintainViews(self):
@ -522,7 +525,9 @@ class LibrarySync(Thread):
# Get views # Get views
sections = downloadutils.DownloadUtils().downloadUrl( sections = downloadutils.DownloadUtils().downloadUrl(
"{server}/library/sections") "{server}/library/sections")
if not sections: try:
sections.attrib
except AttributeError:
self.logMsg("Error download PMS views, abort maintainViews", -1) self.logMsg("Error download PMS views, abort maintainViews", -1)
return False return False
@ -572,7 +577,7 @@ class LibrarySync(Thread):
} }
self.views.append(entry) self.views.append(entry)
log("Removing views: %s" % self.old_views, 1) self.logMsg("Removing views: %s" % self.old_views, 1)
for view in self.old_views: for view in self.old_views:
emby_db.removeView(view) emby_db.removeView(view)
@ -610,7 +615,7 @@ class LibrarySync(Thread):
= {itemid: checksum} = {itemid: checksum}
""" """
if self.compare or not dontCheck: if self.compare or not dontCheck:
# Manual sync # Only process the delta - new or changed items
for item in xml: for item in xml:
itemId = item.attrib.get('ratingKey') itemId = item.attrib.get('ratingKey')
# Skipping items 'title=All episodes' without a 'ratingKey' # Skipping items 'title=All episodes' without a 'ratingKey'
@ -621,9 +626,9 @@ class LibrarySync(Thread):
% (itemId, item.attrib.get('updatedAt', ''))) % (itemId, item.attrib.get('updatedAt', '')))
self.allPlexElementsId[itemId] = plex_checksum self.allPlexElementsId[itemId] = plex_checksum
kodi_checksum = self.allKodiElementsId.get(itemId) kodi_checksum = self.allKodiElementsId.get(itemId)
# Only update if movie is not in Kodi or checksum is
# different
if kodi_checksum != plex_checksum: if kodi_checksum != plex_checksum:
# Only update if movie is not in Kodi or checksum is
# different
self.updatelist.append({'itemId': itemId, self.updatelist.append({'itemId': itemId,
'itemType': itemType, 'itemType': itemType,
'method': method, 'method': method,
@ -986,7 +991,7 @@ class LibrarySync(Thread):
'Audio': {'type': 10} 'Audio': {'type': 10}
} }
# Process artist, then album and tracks last # Process artist, then album and tracks last to minimize overhead
for kind in ('MusicArtist', 'MusicAlbum', 'Audio'): for kind in ('MusicArtist', 'MusicAlbum', 'Audio'):
if self.threadStopped(): if self.threadStopped():
return True return True
@ -1047,8 +1052,8 @@ class LibrarySync(Thread):
if currMajor > minMajor: if currMajor > minMajor:
return True return True
elif currMajor == minMajor and (currMinor > minMinor or elif (currMajor == minMajor and (currMinor > minMinor or
(currMinor == minMinor and currPatch >= minPatch)): (currMinor == minMinor and currPatch >= minPatch))):
return True return True
else: else:
# Database out of date. # Database out of date.
@ -1138,7 +1143,8 @@ class LibrarySync(Thread):
log("SyncDatabase (finished in: %s) %s" log("SyncDatabase (finished in: %s) %s"
% (str(elapsedTime).split('.')[0], librarySync), 1) % (str(elapsedTime).split('.')[0], librarySync), 1)
# Only try the initial sync once per kodi session regardless # Only try the initial sync once per kodi session regardless
# This will prevent an infinite loop in case something goes wrong. # This will prevent an infinite loop in case something goes
# wrong.
startupComplete = True startupComplete = True
settings('SyncInstallRunDone', value="true") settings('SyncInstallRunDone', value="true")
settings("dbCreatedWithVersion", self.clientInfo.getVersion()) settings("dbCreatedWithVersion", self.clientInfo.getVersion())