Optimize code

This commit is contained in:
croneter 2018-03-10 15:03:31 +01:00
parent f2fea1bcde
commit 5a2d3f4238

View file

@ -754,20 +754,15 @@ class TVShows(Items):
LOG.error('Could not find parent tv show for season %s. ' LOG.error('Could not find parent tv show for season %s. '
'Skipping season for now.', plex_id) 'Skipping season for now.', plex_id)
return return
seasonid = self.kodi_db.add_season(showid, seasonnum) seasonid = self.kodi_db.add_season(showid, seasonnum)
checksum = api.checksum() checksum = api.checksum()
# Check whether Season already exists # Check whether Season already exists
plex_dbitem = plex_db.getItem_byId(plex_id) plex_dbitem = plex_db.getItem_byId(plex_id)
update_item = False if plex_dbitem is None else True update_item = False if plex_dbitem is None else True
artwork.modify_artwork(api.artwork(),
# Process artwork
allartworks = api.artwork()
artwork.modify_artwork(allartworks,
seasonid, seasonid,
v.KODI_TYPE_SEASON, v.KODI_TYPE_SEASON,
kodicursor) kodicursor)
if update_item: if update_item:
# Update a reference: checksum in plex table # Update a reference: checksum in plex table
plex_db.updateReference(plex_id, checksum) plex_db.updateReference(plex_id, checksum)