Merge pull request #713 from croneter/fix-collections

Fix processing of collections in special cases
This commit is contained in:
croneter 2019-02-08 15:20:00 +01:00 committed by GitHub
commit 7a0b9c8fca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -189,7 +189,7 @@ class Movie(ItemBase):
# e.g. when added via websocket
LOG.debug('Costly looking up Plex collection %s: %s',
plex_set_id, set_name)
for index, coll_plex_id in api.collections_match():
for index, coll_plex_id in api.collections_match(section_id):
# Get Plex artwork for collections - a pain
if index == plex_set_id:
set_xml = PF.GetPlexMetadata(coll_plex_id)

View file

@ -1256,7 +1256,7 @@ class API(object):
"""
return self.item.get('librarySectionID')
def collections_match(self):
def collections_match(self, section_id):
"""
Downloads one additional xml from the PMS in order to return a list of
tuples [(collection_id, plex_id), ...] for all collections of the
@ -1264,7 +1264,7 @@ class API(object):
Pass in the collection id of e.g. the movie's metadata
"""
if self.collections is None:
self.collections = PF.collections(self.library_section_id())
self.collections = PF.collections(section_id)
if self.collections is None:
LOG.error('Could not download collections for %s',
self.library_section_id())