|
|
|
@ -209,9 +209,9 @@ def show(show_id, folder=None, no_search=False):
|
|
|
|
|
@app.command(help='Add multiple shows to Sonarr.', context_settings=dict(max_content_width=100))
|
|
|
|
|
@click.option(
|
|
|
|
|
'--list-type', '-t',
|
|
|
|
|
help='Trakt list to process. '
|
|
|
|
|
help='Trakt list to process. \n'
|
|
|
|
|
'For example, \'anticipated\', \'trending\', \'popular\', \'person\', \'watched\', \'played\', '
|
|
|
|
|
'\'recommended\', \'watchlist\', or any URL to a list',
|
|
|
|
|
'\'recommended\', \'watchlist\', or any URL to a list.',
|
|
|
|
|
required=True)
|
|
|
|
|
@click.option(
|
|
|
|
|
'--add-limit', '-l',
|
|
|
|
@ -232,6 +232,7 @@ def show(show_id, folder=None, no_search=False):
|
|
|
|
|
'--genre', '-g',
|
|
|
|
|
default=None,
|
|
|
|
|
help='Only add shows from this genre to Sonarr. '
|
|
|
|
|
'Only one genre can be specified. \n'
|
|
|
|
|
'Use \'ignore\' to add shows from any genre, including ones with no genre specified.')
|
|
|
|
|
@click.option(
|
|
|
|
|
'--folder', '-f',
|
|
|
|
@ -241,11 +242,12 @@ def show(show_id, folder=None, no_search=False):
|
|
|
|
|
'--actor', '-a',
|
|
|
|
|
default=None,
|
|
|
|
|
help='Only add movies from this actor to Radarr. '
|
|
|
|
|
'Only one actor can be specified. \n'
|
|
|
|
|
'Requires the \'person\' list option.')
|
|
|
|
|
@click.option(
|
|
|
|
|
'--include-non-acting-roles',
|
|
|
|
|
is_flag=True,
|
|
|
|
|
help='Include non-acting roles such as \'As Himself\', \'Narrator\', etc. '
|
|
|
|
|
help='Include non-acting roles such as \'As Himself\', \'Narrator\', etc. \n'
|
|
|
|
|
'Requires the \'person\' list option with the \'actor\' argument.')
|
|
|
|
|
@click.option(
|
|
|
|
|
'--no-search',
|
|
|
|
@ -257,7 +259,7 @@ def show(show_id, folder=None, no_search=False):
|
|
|
|
|
help='Send notifications.')
|
|
|
|
|
@click.option(
|
|
|
|
|
'--authenticate-user',
|
|
|
|
|
help='Specify which user to authenticate with to retrieve Trakt lists. '
|
|
|
|
|
help='Specify which user to authenticate with to retrieve Trakt lists. \n'
|
|
|
|
|
'Defaults to first user in the config')
|
|
|
|
|
@click.option(
|
|
|
|
|
'--ignore-blacklist',
|
|
|
|
@ -279,11 +281,14 @@ def shows(list_type, add_limit=0, add_delay=2.5, sort='votes', genre=None, folde
|
|
|
|
|
|
|
|
|
|
added_shows = 0
|
|
|
|
|
|
|
|
|
|
# set special genre keyword 'ignore' if supplied
|
|
|
|
|
if genre and genre.lower == 'ignore':
|
|
|
|
|
# process genre
|
|
|
|
|
if genre:
|
|
|
|
|
# set special genre keyword to show's blacklisted_genres list
|
|
|
|
|
if genre.lower() == 'ignore':
|
|
|
|
|
cfg['filters']['shows']['blacklisted_genres'] = ['ignore']
|
|
|
|
|
# remove genre from shows blacklisted_genres if supplied
|
|
|
|
|
elif genre:
|
|
|
|
|
genre = None
|
|
|
|
|
# remove genre from show's blacklisted_genres list
|
|
|
|
|
else:
|
|
|
|
|
misc_helper.unblacklist_genres(genre, cfg['filters']['shows']['blacklisted_genres'])
|
|
|
|
|
|
|
|
|
|
# replace sonarr root_folder if folder is supplied
|
|
|
|
@ -304,16 +309,13 @@ def shows(list_type, add_limit=0, add_delay=2.5, sort='votes', genre=None, folde
|
|
|
|
|
|
|
|
|
|
# get trakt series list
|
|
|
|
|
if list_type.lower() == 'anticipated':
|
|
|
|
|
trakt_objects_list = trakt.get_anticipated_shows(genres=genre if genre and
|
|
|
|
|
'ignore' not in genre.lower() else None,
|
|
|
|
|
trakt_objects_list = trakt.get_anticipated_shows(genres=genre,
|
|
|
|
|
languages=cfg.filters.shows.allowed_languages)
|
|
|
|
|
elif list_type.lower() == 'trending':
|
|
|
|
|
trakt_objects_list = trakt.get_trending_shows(genres=genre if genre and
|
|
|
|
|
'ignore' not in genre.lower() else None,
|
|
|
|
|
trakt_objects_list = trakt.get_trending_shows(genres=genre,
|
|
|
|
|
languages=cfg.filters.shows.allowed_languages)
|
|
|
|
|
elif list_type.lower() == 'popular':
|
|
|
|
|
trakt_objects_list = trakt.get_popular_shows(genres=genre if genre and
|
|
|
|
|
'ignore' not in genre.lower() else None,
|
|
|
|
|
trakt_objects_list = trakt.get_popular_shows(genres=genre,
|
|
|
|
|
languages=cfg.filters.shows.allowed_languages)
|
|
|
|
|
elif list_type.lower() == 'person':
|
|
|
|
|
if not actor:
|
|
|
|
@ -321,25 +323,21 @@ def shows(list_type, add_limit=0, add_delay=2.5, sort='votes', genre=None, folde
|
|
|
|
|
" list type!")
|
|
|
|
|
return None
|
|
|
|
|
trakt_objects_list = trakt.get_person_shows(person=actor,
|
|
|
|
|
genres=genre if genre and
|
|
|
|
|
'ignore' not in genre.lower() else None,
|
|
|
|
|
genres=genre,
|
|
|
|
|
languages=cfg.filters.shows.allowed_languages,
|
|
|
|
|
include_non_acting_roles=include_non_acting_roles)
|
|
|
|
|
elif list_type.lower() == 'recommended':
|
|
|
|
|
trakt_objects_list = trakt.get_recommended_shows(authenticate_user,
|
|
|
|
|
genres=genre if genre
|
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
genres=genre,
|
|
|
|
|
languages=cfg.filters.shows.allowed_languages)
|
|
|
|
|
elif list_type.lower().startswith('played'):
|
|
|
|
|
most_type = misc_helper.substring_after(list_type.lower(), "_")
|
|
|
|
|
trakt_objects_list = trakt.get_most_played_shows(genres=genre if genre
|
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
trakt_objects_list = trakt.get_most_played_shows(genres=genre,
|
|
|
|
|
languages=cfg.filters.shows.allowed_languages,
|
|
|
|
|
most_type=most_type if most_type else None)
|
|
|
|
|
elif list_type.lower().startswith('watched'):
|
|
|
|
|
most_type = misc_helper.substring_after(list_type.lower(), "_")
|
|
|
|
|
trakt_objects_list = trakt.get_most_watched_shows(genres=genre if genre
|
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
trakt_objects_list = trakt.get_most_watched_shows(genres=genre,
|
|
|
|
|
languages=cfg.filters.shows.allowed_languages,
|
|
|
|
|
most_type=most_type if most_type else None)
|
|
|
|
|
elif list_type.lower() == 'watchlist':
|
|
|
|
@ -550,9 +548,9 @@ def movie(movie_id, folder=None, minimum_availability=None, no_search=False):
|
|
|
|
|
@app.command(help='Add multiple movies to Radarr.', context_settings=dict(max_content_width=100))
|
|
|
|
|
@click.option(
|
|
|
|
|
'--list-type', '-t',
|
|
|
|
|
help='Trakt list to process. '
|
|
|
|
|
help='Trakt list to process. \n'
|
|
|
|
|
'For example, \'anticipated\', \'trending\', \'popular\', \'person\', \'watched\', \'played\', '
|
|
|
|
|
'\'recommended\', \'watchlist\', or any URL to a list',
|
|
|
|
|
'\'recommended\', \'watchlist\', or any URL to a list.',
|
|
|
|
|
required=True)
|
|
|
|
|
@click.option(
|
|
|
|
|
'--add-limit', '-l',
|
|
|
|
@ -577,6 +575,7 @@ def movie(movie_id, folder=None, minimum_availability=None, no_search=False):
|
|
|
|
|
'--genre', '-g',
|
|
|
|
|
default=None,
|
|
|
|
|
help='Only add movies from this genre to Radarr. '
|
|
|
|
|
'Only one genre can be specified. \n'
|
|
|
|
|
'Use \'ignore\' to add movies from any genre, including ones with no genre specified.')
|
|
|
|
|
@click.option(
|
|
|
|
|
'--folder', '-f',
|
|
|
|
@ -590,11 +589,12 @@ def movie(movie_id, folder=None, minimum_availability=None, no_search=False):
|
|
|
|
|
'--actor', '-a',
|
|
|
|
|
default=None,
|
|
|
|
|
help='Only add movies from this actor to Radarr.'
|
|
|
|
|
'Only one actor can be specified. \n'
|
|
|
|
|
'Requires the \'person\' list.')
|
|
|
|
|
@click.option(
|
|
|
|
|
'--include-non-acting-roles',
|
|
|
|
|
is_flag=True,
|
|
|
|
|
help='Include non-acting roles such as \'As Himself\', \'Narrator\', etc. '
|
|
|
|
|
help='Include non-acting roles such as \'As Himself\', \'Narrator\', etc. \n'
|
|
|
|
|
'Requires the \'person\' list option with the \'actor\' argument.')
|
|
|
|
|
@click.option(
|
|
|
|
|
'--no-search',
|
|
|
|
@ -606,8 +606,8 @@ def movie(movie_id, folder=None, minimum_availability=None, no_search=False):
|
|
|
|
|
help='Send notifications.')
|
|
|
|
|
@click.option(
|
|
|
|
|
'--authenticate-user',
|
|
|
|
|
help='Specify which user to authenticate with to retrieve Trakt lists. '
|
|
|
|
|
'Default: first user in the config.')
|
|
|
|
|
help='Specify which user to authenticate with to retrieve Trakt lists. \n'
|
|
|
|
|
'Defaults to first user in the config.')
|
|
|
|
|
@click.option(
|
|
|
|
|
'--ignore-blacklist',
|
|
|
|
|
is_flag=True,
|
|
|
|
@ -629,11 +629,14 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rating=None, gen
|
|
|
|
|
|
|
|
|
|
added_movies = 0
|
|
|
|
|
|
|
|
|
|
# set special genre keyword 'ignore' if supplied
|
|
|
|
|
if genre and genre.lower() == 'ignore':
|
|
|
|
|
# process genre
|
|
|
|
|
if genre:
|
|
|
|
|
# set special genre keyword to movies's blacklisted_genres list
|
|
|
|
|
if genre.lower() == 'ignore':
|
|
|
|
|
cfg['filters']['movies']['blacklisted_genres'] = ['ignore']
|
|
|
|
|
# remove genre from movies blacklisted_genres if supplied
|
|
|
|
|
elif genre:
|
|
|
|
|
genre = None
|
|
|
|
|
# remove genre from movies's blacklisted_genres list
|
|
|
|
|
else:
|
|
|
|
|
misc_helper.unblacklist_genres(genre, cfg['filters']['movies']['blacklisted_genres'])
|
|
|
|
|
|
|
|
|
|
# replace radarr root_folder if folder is supplied
|
|
|
|
@ -664,45 +667,39 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rating=None, gen
|
|
|
|
|
|
|
|
|
|
# get trakt movies list
|
|
|
|
|
if list_type.lower() == 'anticipated':
|
|
|
|
|
trakt_objects_list = trakt.get_anticipated_movies(genres=genre if genre
|
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
trakt_objects_list = trakt.get_anticipated_movies(genres=genre,
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages)
|
|
|
|
|
elif list_type.lower() == 'trending':
|
|
|
|
|
trakt_objects_list = trakt.get_trending_movies(genres=genre if genre
|
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
trakt_objects_list = trakt.get_trending_movies(genres=genre,
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages)
|
|
|
|
|
elif list_type.lower() == 'popular':
|
|
|
|
|
trakt_objects_list = trakt.get_popular_movies(genres=genre if genre
|
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
trakt_objects_list = trakt.get_popular_movies(genres=genre,
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages)
|
|
|
|
|
elif list_type.lower() == 'boxoffice':
|
|
|
|
|
trakt_objects_list = trakt.get_boxoffice_movies()
|
|
|
|
|
trakt_objects_list = trakt.get_boxoffice_movies(genres=genre,
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages)
|
|
|
|
|
elif list_type.lower() == 'person':
|
|
|
|
|
if not actor:
|
|
|
|
|
log.error("You must specify an actor with the \'--actor\' / \'-a\' parameter when using the \'person\'" +
|
|
|
|
|
" list type!")
|
|
|
|
|
return None
|
|
|
|
|
trakt_objects_list = trakt.get_person_movies(person=actor,
|
|
|
|
|
genres=genre if genre
|
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
genres=genre,
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages,
|
|
|
|
|
include_non_acting_roles=include_non_acting_roles)
|
|
|
|
|
|
|
|
|
|
elif list_type.lower() == 'recommended':
|
|
|
|
|
trakt_objects_list = trakt.get_recommended_movies(authenticate_user,
|
|
|
|
|
genres=genre if genre
|
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
genres=genre,
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages)
|
|
|
|
|
elif list_type.lower().startswith('played'):
|
|
|
|
|
most_type = misc_helper.substring_after(list_type.lower(), "_")
|
|
|
|
|
trakt_objects_list = trakt.get_most_played_movies(genres=genre if genre
|
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
trakt_objects_list = trakt.get_most_played_movies(genres=genre,
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages,
|
|
|
|
|
most_type=most_type if most_type else None)
|
|
|
|
|
elif list_type.lower().startswith('watched'):
|
|
|
|
|
most_type = misc_helper.substring_after(list_type.lower(), "_")
|
|
|
|
|
trakt_objects_list = trakt.get_most_watched_movies(genres=genre if genre
|
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
trakt_objects_list = trakt.get_most_watched_movies(genres=genre,
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages,
|
|
|
|
|
most_type=most_type if most_type else None)
|
|
|
|
|
elif list_type.lower() == 'watchlist':
|
|
|
|
|