def get_latest_episode(series):
 session = Session.object_session(series)
 episode = session.query(Episode).join(Episode.series).filter((Series.id == series.id)).filter((Episode.season != None)).order_by(desc(Episode.season)).order_by(desc(Episode.number)).first()
 if (not episode):
  return False
 return episode

def get_latest_episode ( series ) : session = Session . object_session ( series ) episode = session . query ( Episode ) . join ( Episode . series ) . filter ( ( Series . id == series . id ) ) . filter ( ( Episode . season != None ) ) . order_by ( desc ( Episode . season ) ) . order_by ( desc ( Episode . number ) ) . first ( ) if ( not episode ) : return False return episode
return latest known identifier in dict for series name .