|
|
@ -185,14 +185,15 @@ def shows(list_type, add_limit=0, add_delay=2.5, genre=None, folder=None, no_sea
|
|
|
|
authenticate_user=None):
|
|
|
|
authenticate_user=None):
|
|
|
|
from media.sonarr import Sonarr
|
|
|
|
from media.sonarr import Sonarr
|
|
|
|
from media.trakt import Trakt
|
|
|
|
from media.trakt import Trakt
|
|
|
|
|
|
|
|
from helpers import misc as misc_helper
|
|
|
|
from helpers import sonarr as sonarr_helper
|
|
|
|
from helpers import sonarr as sonarr_helper
|
|
|
|
from helpers import trakt as trakt_helper
|
|
|
|
from helpers import trakt as trakt_helper
|
|
|
|
|
|
|
|
|
|
|
|
added_shows = 0
|
|
|
|
added_shows = 0
|
|
|
|
|
|
|
|
|
|
|
|
# remove genre from shows blacklisted_genres if supplied
|
|
|
|
# remove genre from shows blacklisted_genres if supplied
|
|
|
|
if genre and genre in cfg.filters.shows.blacklisted_genres:
|
|
|
|
if genre:
|
|
|
|
cfg['filters']['shows']['blacklisted_genres'].remove(genre)
|
|
|
|
misc_helper.unblacklist_genres(genre, cfg['filters']['shows']['blacklisted_genres'])
|
|
|
|
|
|
|
|
|
|
|
|
# replace sonarr root_folder if folder is supplied
|
|
|
|
# replace sonarr root_folder if folder is supplied
|
|
|
|
if folder:
|
|
|
|
if folder:
|
|
|
@ -212,11 +213,11 @@ def shows(list_type, add_limit=0, add_delay=2.5, genre=None, folder=None, no_sea
|
|
|
|
|
|
|
|
|
|
|
|
# get trakt series list
|
|
|
|
# get trakt series list
|
|
|
|
if list_type.lower() == 'anticipated':
|
|
|
|
if list_type.lower() == 'anticipated':
|
|
|
|
trakt_objects_list = trakt.get_anticipated_shows()
|
|
|
|
trakt_objects_list = trakt.get_anticipated_shows(genres=genre, languages=cfg.filters.shows.allowed_languages)
|
|
|
|
elif list_type.lower() == 'trending':
|
|
|
|
elif list_type.lower() == 'trending':
|
|
|
|
trakt_objects_list = trakt.get_trending_shows()
|
|
|
|
trakt_objects_list = trakt.get_trending_shows(genres=genre, languages=cfg.filters.shows.allowed_languages)
|
|
|
|
elif list_type.lower() == 'popular':
|
|
|
|
elif list_type.lower() == 'popular':
|
|
|
|
trakt_objects_list = trakt.get_popular_shows()
|
|
|
|
trakt_objects_list = trakt.get_popular_shows(genres=genre, languages=cfg.filters.shows.allowed_languages)
|
|
|
|
elif list_type.lower() == 'watchlist':
|
|
|
|
elif list_type.lower() == 'watchlist':
|
|
|
|
trakt_objects_list = trakt.get_watchlist_shows(authenticate_user)
|
|
|
|
trakt_objects_list = trakt.get_watchlist_shows(authenticate_user)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
@ -254,8 +255,8 @@ def shows(list_type, add_limit=0, add_delay=2.5, genre=None, folder=None, no_sea
|
|
|
|
for series in sorted_series_list:
|
|
|
|
for series in sorted_series_list:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
# check if genre matches genre supplied via argument
|
|
|
|
# check if genre matches genre supplied via argument
|
|
|
|
if genre and genre.lower() not in series['show']['genres']:
|
|
|
|
if genre and not misc_helper.allowed_genres(genre, 'show', series):
|
|
|
|
log.debug("Skipping: %s because it was not from %s genre", series['show']['title'], genre.lower())
|
|
|
|
log.debug("Skipping: %s because it was not from %s genre(s)", series['show']['title'], genre.lower())
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
# check if series passes out blacklist criteria inspection
|
|
|
|
# check if series passes out blacklist criteria inspection
|
|
|
@ -361,14 +362,15 @@ def movies(list_type, add_limit=0, add_delay=2.5, genre=None, folder=None, no_se
|
|
|
|
authenticate_user=None):
|
|
|
|
authenticate_user=None):
|
|
|
|
from media.radarr import Radarr
|
|
|
|
from media.radarr import Radarr
|
|
|
|
from media.trakt import Trakt
|
|
|
|
from media.trakt import Trakt
|
|
|
|
|
|
|
|
from helpers import misc as misc_helper
|
|
|
|
from helpers import radarr as radarr_helper
|
|
|
|
from helpers import radarr as radarr_helper
|
|
|
|
from helpers import trakt as trakt_helper
|
|
|
|
from helpers import trakt as trakt_helper
|
|
|
|
|
|
|
|
|
|
|
|
added_movies = 0
|
|
|
|
added_movies = 0
|
|
|
|
|
|
|
|
|
|
|
|
# remove genre from movies blacklisted_genres if supplied
|
|
|
|
# remove genre from movies blacklisted_genres if supplied
|
|
|
|
if genre and genre in cfg.filters.movies.blacklisted_genres:
|
|
|
|
if genre:
|
|
|
|
cfg['filters']['movies']['blacklisted_genres'].remove(genre)
|
|
|
|
misc_helper.unblacklist_genres(genre, cfg['filters']['movies']['blacklisted_genres'])
|
|
|
|
|
|
|
|
|
|
|
|
# replace radarr root_folder if folder is supplied
|
|
|
|
# replace radarr root_folder if folder is supplied
|
|
|
|
if folder:
|
|
|
|
if folder:
|
|
|
@ -387,11 +389,11 @@ def movies(list_type, add_limit=0, add_delay=2.5, genre=None, folder=None, no_se
|
|
|
|
|
|
|
|
|
|
|
|
# get trakt movies list
|
|
|
|
# get trakt movies list
|
|
|
|
if list_type.lower() == 'anticipated':
|
|
|
|
if list_type.lower() == 'anticipated':
|
|
|
|
trakt_objects_list = trakt.get_anticipated_movies()
|
|
|
|
trakt_objects_list = trakt.get_anticipated_movies(genres=genre, languages=cfg.filters.movies.allowed_languages)
|
|
|
|
elif list_type.lower() == 'trending':
|
|
|
|
elif list_type.lower() == 'trending':
|
|
|
|
trakt_objects_list = trakt.get_trending_movies()
|
|
|
|
trakt_objects_list = trakt.get_trending_movies(genres=genre, languages=cfg.filters.movies.allowed_languages)
|
|
|
|
elif list_type.lower() == 'popular':
|
|
|
|
elif list_type.lower() == 'popular':
|
|
|
|
trakt_objects_list = trakt.get_popular_movies()
|
|
|
|
trakt_objects_list = trakt.get_popular_movies(genres=genre, languages=cfg.filters.movies.allowed_languages)
|
|
|
|
elif list_type.lower() == 'boxoffice':
|
|
|
|
elif list_type.lower() == 'boxoffice':
|
|
|
|
trakt_objects_list = trakt.get_boxoffice_movies()
|
|
|
|
trakt_objects_list = trakt.get_boxoffice_movies()
|
|
|
|
elif list_type.lower() == 'watchlist':
|
|
|
|
elif list_type.lower() == 'watchlist':
|
|
|
@ -431,8 +433,8 @@ def movies(list_type, add_limit=0, add_delay=2.5, genre=None, folder=None, no_se
|
|
|
|
for movie in sorted_movies_list:
|
|
|
|
for movie in sorted_movies_list:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
# check if genre matches genre supplied via argument
|
|
|
|
# check if genre matches genre supplied via argument
|
|
|
|
if genre and genre.lower() not in movie['movie']['genres']:
|
|
|
|
if genre and not misc_helper.allowed_genres(genre, 'movie', movie):
|
|
|
|
log.debug("Skipping: %s because it was not from %s genre", movie['movie']['title'], genre.lower())
|
|
|
|
log.debug("Skipping: %s because it was not from %s genre(s)", movie['movie']['title'], genre.lower())
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
# check if movie passes out blacklist criteria inspection
|
|
|
|
# check if movie passes out blacklist criteria inspection
|
|
|
|