Streamline code
This commit is contained in:
parent
4b0583b1c9
commit
c02a95cc59
1 changed files with 1 additions and 4 deletions
|
@ -1437,12 +1437,9 @@ class LibrarySync(Thread):
|
||||||
def process_newitems(self, item):
|
def process_newitems(self, item):
|
||||||
ratingKey = item['ratingKey']
|
ratingKey = item['ratingKey']
|
||||||
xml = PF.GetPlexMetadata(ratingKey)
|
xml = PF.GetPlexMetadata(ratingKey)
|
||||||
if xml in (None, 401):
|
|
||||||
log.error('Could not download data for %s, skipping' % ratingKey)
|
|
||||||
return False, item
|
|
||||||
try:
|
try:
|
||||||
mediatype = xml[0].attrib['type']
|
mediatype = xml[0].attrib['type']
|
||||||
except (IndexError, KeyError):
|
except (IndexError, KeyError, TypeError):
|
||||||
log.error('Could not download metadata for %s' % ratingKey)
|
log.error('Could not download metadata for %s' % ratingKey)
|
||||||
return False, item
|
return False, item
|
||||||
log.debug("Processing new/updated PMS item: %s" % ratingKey)
|
log.debug("Processing new/updated PMS item: %s" % ratingKey)
|
||||||
|
|
Loading…
Reference in a new issue