Simplify code

This commit is contained in:
croneter 2018-11-03 10:39:49 +01:00
parent 335c0175a7
commit d0d6798bb1

View file

@ -47,20 +47,16 @@ class PlexDBBase(object):
answ = None answ = None
if plex_type == v.PLEX_TYPE_MOVIE: if plex_type == v.PLEX_TYPE_MOVIE:
entry = self.movie(plex_id) entry = self.movie(plex_id)
if entry: answ = self.entry_to_movie(entry)
answ = self.entry_to_movie(entry)
elif plex_type == v.PLEX_TYPE_EPISODE: elif plex_type == v.PLEX_TYPE_EPISODE:
entry = self.episode(plex_id) entry = self.episode(plex_id)
if entry: answ = self.entry_to_episode(entry)
answ = self.entry_to_episode(entry)
elif plex_type == v.PLEX_TYPE_SHOW: elif plex_type == v.PLEX_TYPE_SHOW:
entry = self.show(plex_id) entry = self.show(plex_id)
if entry: answ = self.entry_to_show(entry)
answ = self.entry_to_show(entry)
elif plex_type == v.PLEX_TYPE_SEASON: elif plex_type == v.PLEX_TYPE_SEASON:
entry = self.season(plex_id) entry = self.season(plex_id)
if entry: answ = self.entry_to_season(entry)
answ = self.entry_to_season(entry)
else: else:
# SLOW - lookup plex_id in all our tables # SLOW - lookup plex_id in all our tables
for kind in (v.PLEX_TYPE_MOVIE, for kind in (v.PLEX_TYPE_MOVIE,