Explicitly check for Nonetype

pull/49/head
davidaghaian@student.cccd.edu 6 years ago
parent 5995985ab2
commit 8474557bc0

@ -522,13 +522,13 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rating=None, gen
else None): else None):
# Assuming the movie is not blacklisted, proceed to pull RT score if the user wishes to restrict # Assuming the movie is not blacklisted, proceed to pull RT score if the user wishes to restrict
movieRating = None movieRating = None
if (rating and cfg['omdb']['api_key'] != ''): if (rating != None and cfg['omdb']['api_key'] != ''):
movieRating = rating_helper.get_rating(cfg['omdb']['api_key'],movie) movieRating = rating_helper.get_rating(cfg['omdb']['api_key'],movie)
if (movieRating == -1): if (movieRating == -1):
log.debug("Skipping: %s because it did not have a rating/lacked imdbID", log.debug("Skipping: %s because it did not have a rating/lacked imdbID",
movie['movie']['title']) movie['movie']['title'])
continue continue
if (not rating or movieRating >= rating): if (rating == None or movieRating >= rating):
log.info("Adding: %s (%d) | Genres: %s | Country: %s", movie['movie']['title'], movie['movie']['year'], log.info("Adding: %s (%d) | Genres: %s | Country: %s", movie['movie']['title'], movie['movie']['year'],
', '.join(movie['movie']['genres']), movie['movie']['country'].upper()) ', '.join(movie['movie']['genres']), movie['movie']['country'].upper())
# add movie to radarr # add movie to radarr

Loading…
Cancel
Save