def blacklisted_show_year(show, earliest_year, latest_year): blacklisted = False try: year = misc_str.get_year_from_timestamp(show['show']['first_aired']) if not year: log.debug( "%s was blacklisted due to having an unknown first_aired date", show['show']['title']) blacklisted = True else: if year < earliest_year or year > latest_year: log.debug("%s was blacklisted because it first aired in: %d", show['show']['title'], year) blacklisted = True except Exception: log.exception( "Exception determining if show is within min_year and max_year range %s:", show) return blacklisted
def blacklisted_show_year(show, earliest_year, latest_year): blacklisted = False try: year = misc_str.get_year_from_timestamp(show['show']['first_aired']) if not year: log.debug("\'%s\' | Blacklisted Years Check | Blacklisted because it had no " "first-aired date specified.", show['show']['title']) blacklisted = True else: if year < earliest_year or year > latest_year: log.debug("\'%s\' | Blacklisted Years Check | Blacklisted because it first aired in: %d", show['show']['title'], year) blacklisted = True if not blacklisted: log.debug("\'%s\' | Blacklisted Years Check | Passed.", show['show']['title']) except Exception: log.exception("Exception determining if show is within min_year and max_year range %s:", show) return blacklisted