|
|
@ -697,9 +697,9 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rating=None, gen
|
|
|
|
sorted_movies_list = misc_helper.sorted_list(processed_movies_list, 'movie', 'votes')
|
|
|
|
sorted_movies_list = misc_helper.sorted_list(processed_movies_list, 'movie', 'votes')
|
|
|
|
log.info("Sorted movies list to process by highest 'votes'")
|
|
|
|
log.info("Sorted movies list to process by highest 'votes'")
|
|
|
|
|
|
|
|
|
|
|
|
# display specified RT score
|
|
|
|
# display specified min RT score
|
|
|
|
if rating is not None and 'omdb' in cfg and 'api_key' in cfg['omdb'] and cfg['omdb']['api_key']:
|
|
|
|
if rating is not None and 'omdb' in cfg and 'api_key' in cfg['omdb'] and cfg['omdb']['api_key']:
|
|
|
|
log.debug("Minimum Rotten Tomatoes score of %d%% requested.", rating)
|
|
|
|
log.info("Minimum Rotten Tomatoes score of %d%% requested.", rating)
|
|
|
|
|
|
|
|
|
|
|
|
# loop movies
|
|
|
|
# loop movies
|
|
|
|
log.info("Processing list now...")
|
|
|
|
log.info("Processing list now...")
|
|
|
@ -725,43 +725,41 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rating=None, gen
|
|
|
|
if not trakt_helper.is_movie_blacklisted(sorted_movie, cfg.filters.movies, ignore_blacklist,
|
|
|
|
if not trakt_helper.is_movie_blacklisted(sorted_movie, cfg.filters.movies, ignore_blacklist,
|
|
|
|
callback_remove_recommended if remove_rejected_from_recommended
|
|
|
|
callback_remove_recommended if remove_rejected_from_recommended
|
|
|
|
else None):
|
|
|
|
else None):
|
|
|
|
# Assuming the movie is not blacklisted, proceed to pull RT score if the user wishes to restrict
|
|
|
|
|
|
|
|
movie_rating = None
|
|
|
|
# Skip movie if below user specified min RT rating
|
|
|
|
if rating is not None and 'omdb' in cfg and 'api_key' in cfg['omdb'] and cfg['omdb']['api_key']:
|
|
|
|
if rating is not None and 'omdb' in cfg and 'api_key' in cfg['omdb'] and cfg['omdb']['api_key']:
|
|
|
|
movie_rating = rating_helper.get_rating(cfg['omdb']['api_key'], sorted_movie)
|
|
|
|
if not rating_helper.does_movie_have_min_req_rating(cfg['omdb']['api_key'], sorted_movie, rating):
|
|
|
|
if movie_rating == -1:
|
|
|
|
|
|
|
|
log.info("SKIPPED: \'%s (%s)\'", sorted_movie['movie']['title'],
|
|
|
|
|
|
|
|
movie_year)
|
|
|
|
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
if (rating is None or movie_rating is None) or movie_rating >= rating:
|
|
|
|
|
|
|
|
log.info("Adding: \'%s (%s)\' | Country: %s | Language: %s | Genre: %s ",
|
|
|
|
log.info("Adding: \'%s (%s)\' | Country: %s | Language: %s | Genre: %s ",
|
|
|
|
sorted_movie['movie']['title'],
|
|
|
|
sorted_movie['movie']['title'], movie_year,
|
|
|
|
movie_year,
|
|
|
|
(sorted_movie['movie']['country'] or 'N/A').upper(),
|
|
|
|
(sorted_movie['movie']['country'] or 'N/A').upper(),
|
|
|
|
(sorted_movie['movie']['language'] or 'N/A').upper(), movie_genres)
|
|
|
|
(sorted_movie['movie']['language'] or 'N/A').upper(),
|
|
|
|
|
|
|
|
movie_genres)
|
|
|
|
# add movie to radarr
|
|
|
|
# add movie to radarr
|
|
|
|
if radarr.add_movie(sorted_movie['movie']['ids']['tmdb'], sorted_movie['movie']['title'],
|
|
|
|
if radarr.add_movie(sorted_movie['movie']['ids']['tmdb'], sorted_movie['movie']['title'],
|
|
|
|
movie_year, sorted_movie['movie']['ids']['slug'], profile_id,
|
|
|
|
movie_year,
|
|
|
|
cfg.radarr.root_folder, cfg.radarr.minimum_availability, not no_search):
|
|
|
|
sorted_movie['movie']['ids']['slug'], profile_id,
|
|
|
|
|
|
|
|
cfg.radarr.root_folder, cfg.radarr.minimum_availability, not no_search):
|
|
|
|
log.info("ADDED: \'%s (%s)\'", sorted_movie['movie']['title'], movie_year)
|
|
|
|
log.info("ADDED: \'%s (%s)\'", sorted_movie['movie']['title'],
|
|
|
|
|
|
|
|
movie_year)
|
|
|
|
if notifications:
|
|
|
|
if notifications:
|
|
|
|
callback_notify({'event': 'add_movie', 'list_type': list_type, 'movie': sorted_movie['movie']})
|
|
|
|
callback_notify({'event': 'add_movie', 'list_type': list_type,
|
|
|
|
|
|
|
|
'movie': sorted_movie['movie']})
|
|
|
|
added_movies += 1
|
|
|
|
added_movies += 1
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
log.error("FAILED ADDING: \'%s (%s)\'", sorted_movie['movie']['title'], movie_year)
|
|
|
|
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
log.debug("Minimum Rotten Tomatoes score of %d%% was not met.", rating)
|
|
|
|
log.error("FAILED ADDING: \'%s (%s)\'", sorted_movie['movie']['title'], movie_year)
|
|
|
|
log.info("SKIPPED: \'%s (%s)\'", sorted_movie['movie']['title'], movie_year)
|
|
|
|
|
|
|
|
# stop adding movies, if added_movies >= add_limit
|
|
|
|
|
|
|
|
if add_limit and added_movies >= add_limit:
|
|
|
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# sleep before adding any more
|
|
|
|
else:
|
|
|
|
time.sleep(add_delay)
|
|
|
|
log.info("SKIPPED: \'%s (%s)\'", sorted_movie['movie']['title'], movie_year)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# stop adding movies, if added_movies >= add_limit
|
|
|
|
|
|
|
|
if add_limit and added_movies >= add_limit:
|
|
|
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# sleep before adding any more
|
|
|
|
|
|
|
|
time.sleep(add_delay)
|
|
|
|
|
|
|
|
|
|
|
|
except Exception:
|
|
|
|
except Exception:
|
|
|
|
log.exception("Exception while processing movie \'%s\': ", sorted_movie['movie']['title'])
|
|
|
|
log.exception("Exception while processing movie \'%s\': ", sorted_movie['movie']['title'])
|
|
|
|