Trakt: Pass range of years to limit api results even further

pull/105/head
desimaniac 5 years ago
parent 64a1b39800
commit 4f487a8411

@ -73,7 +73,8 @@ class Trakt:
@backoff.on_predicate(backoff.expo, lambda x: x is None, max_tries=6, on_backoff=backoff_handler) @backoff.on_predicate(backoff.expo, lambda x: x is None, max_tries=6, on_backoff=backoff_handler)
def _make_items_request(self, url, limit, type_name, object_name, authenticate_user=None, payload={}, def _make_items_request(self, url, limit, type_name, object_name, authenticate_user=None, payload={},
sleep_between=5, countries=None, languages=None, genres=None, include_non_acting_roles=False): sleep_between=5, years=None, countries=None, languages=None, genres=None,
include_non_acting_roles=False):
# languages # languages
if not languages: if not languages:
@ -87,6 +88,10 @@ class Trakt:
'languages': languages, 'languages': languages,
}) })
# years
if years:
payload['years'] = years
# countries # countries
if countries: if countries:
payload['countries'] = ','.join(countries).lower() payload['countries'] = ','.join(countries).lower()
@ -163,6 +168,8 @@ class Trakt:
else: else:
processed.append(item) processed.append(item)
elif resp_data == '[]':
log.warning("Received empty JSON response for page: %d of %d", current_page, total_pages)
else: else:
log.warning("Received malformed JSON response for page: %d of %d", current_page, total_pages) log.warning("Received malformed JSON response for page: %d of %d", current_page, total_pages)
@ -402,48 +409,52 @@ class Trakt:
) )
@cache(cache_file=cachefile, retry_if_blank=True) @cache(cache_file=cachefile, retry_if_blank=True)
def get_trending_shows(self, limit=1000, countries=None, languages=None, genres=None): def get_trending_shows(self, limit=1000, years=None, countries=None, languages=None, genres=None):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/shows/trending', url='https://api.trakt.tv/shows/trending',
object_name='shows', object_name='shows',
type_name='trending', type_name='trending',
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
) )
@cache(cache_file=cachefile, retry_if_blank=True) @cache(cache_file=cachefile, retry_if_blank=True)
def get_popular_shows(self, limit=1000, countries=None, languages=None, genres=None): def get_popular_shows(self, limit=1000, years=None, countries=None, languages=None, genres=None):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/shows/popular', url='https://api.trakt.tv/shows/popular',
object_name='shows', object_name='shows',
type_name='popular', type_name='popular',
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
) )
@cache(cache_file=cachefile, retry_if_blank=True) @cache(cache_file=cachefile, retry_if_blank=True)
def get_anticipated_shows(self, limit=1000, countries=None, languages=None, genres=None): def get_anticipated_shows(self, limit=1000, years=None, countries=None, languages=None, genres=None):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/shows/anticipated', url='https://api.trakt.tv/shows/anticipated',
object_name='shows', object_name='shows',
type_name='anticipated', type_name='anticipated',
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
) )
def get_person_shows(self, person, limit=1000, countries=None, languages=None, genres=None, def get_person_shows(self, person, limit=1000, years=None, countries=None, languages=None, genres=None,
include_non_acting_roles=False): include_non_acting_roles=False):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/people/%s/shows' % person.replace(' ', '-').lower(), url='https://api.trakt.tv/people/%s/shows' % person.replace(' ', '-').lower(),
object_name='shows', object_name='shows',
type_name='person', type_name='person',
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
@ -451,55 +462,64 @@ class Trakt:
) )
@cache(cache_file=cachefile, retry_if_blank=True) @cache(cache_file=cachefile, retry_if_blank=True)
def get_most_played_shows(self, limit=1000, countries=None, languages=None, genres=None, most_type=None): def get_most_played_shows(self, limit=1000, years=None, countries=None, languages=None, genres=None,
most_type=None):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/shows/played/%s' % ('weekly' if not most_type else most_type), url='https://api.trakt.tv/shows/played/%s' % ('weekly' if not most_type else most_type),
object_name='shows', object_name='shows',
type_name='played', type_name='played',
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
) )
@cache(cache_file=cachefile, retry_if_blank=True) @cache(cache_file=cachefile, retry_if_blank=True)
def get_most_watched_shows(self, limit=1000, languages=None, countries=None, genres=None, most_type=None): def get_most_watched_shows(self, limit=1000, years=None, countries=None, languages=None, genres=None,
most_type=None):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/shows/watched/%s' % ('weekly' if not most_type else most_type), url='https://api.trakt.tv/shows/watched/%s' % ('weekly' if not most_type else most_type),
object_name='shows', object_name='shows',
type_name='watched', type_name='watched',
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
) )
@cache(cache_file=cachefile, retry_if_blank=True) @cache(cache_file=cachefile, retry_if_blank=True)
def get_recommended_shows(self, authenticate_user=None, limit=1000, countries=None, languages=None, genres=None): def get_recommended_shows(self, authenticate_user=None, limit=1000, years=None, countries=None, languages=None,
genres=None):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/recommendations/shows', url='https://api.trakt.tv/recommendations/shows',
object_name='shows', object_name='shows',
type_name='recommended from {authenticate_user}', type_name='recommended from {authenticate_user}',
authenticate_user=authenticate_user, authenticate_user=authenticate_user,
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
) )
def get_watchlist_shows(self, authenticate_user=None, limit=1000, countries=None, languages=None): def get_watchlist_shows(self, authenticate_user=None, limit=1000, years=None, countries=None, languages=None,
genres=None):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/users/{authenticate_user}/watchlist/shows', url='https://api.trakt.tv/users/{authenticate_user}/watchlist/shows',
object_name='shows', object_name='shows',
type_name='watchlist from {authenticate_user}', type_name='watchlist from {authenticate_user}',
authenticate_user=authenticate_user, authenticate_user=authenticate_user,
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
) )
def get_user_list_shows(self, list_url, authenticate_user=None, limit=1000, countries=None, languages=None): def get_user_list_shows(self, list_url, authenticate_user=None, limit=1000, years=None, countries=None,
languages=None, genres=None):
list_user, list_key = extract_list_user_and_key_from_url(list_url) list_user, list_key = extract_list_user_and_key_from_url(list_url)
log.debug('Fetching %s from %s', list_key, list_user) log.debug('Fetching %s from %s', list_key, list_user)
@ -510,6 +530,7 @@ class Trakt:
type_name=(list_key + ' from ' + list_user), type_name=(list_key + ' from ' + list_user),
authenticate_user=authenticate_user, authenticate_user=authenticate_user,
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
@ -526,48 +547,52 @@ class Trakt:
) )
@cache(cache_file=cachefile, retry_if_blank=True) @cache(cache_file=cachefile, retry_if_blank=True)
def get_trending_movies(self, limit=1000, countries=None, languages=None, genres=None): def get_trending_movies(self, limit=1000, years=None, countries=None, languages=None, genres=None):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/movies/trending', url='https://api.trakt.tv/movies/trending',
object_name='movies', object_name='movies',
type_name='trending', type_name='trending',
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
) )
@cache(cache_file=cachefile, retry_if_blank=True) @cache(cache_file=cachefile, retry_if_blank=True)
def get_popular_movies(self, limit=1000, countries=None, languages=None, genres=None): def get_popular_movies(self, limit=1000, years=None, countries=None, languages=None, genres=None):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/movies/popular', url='https://api.trakt.tv/movies/popular',
object_name='movies', object_name='movies',
type_name='popular', type_name='popular',
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
) )
@cache(cache_file=cachefile, retry_if_blank=True) @cache(cache_file=cachefile, retry_if_blank=True)
def get_anticipated_movies(self, limit=1000, countries=None, languages=None, genres=None): def get_anticipated_movies(self, limit=1000, years=None, countries=None, languages=None, genres=None):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/movies/anticipated', url='https://api.trakt.tv/movies/anticipated',
object_name='movies', object_name='movies',
type_name='anticipated', type_name='anticipated',
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
) )
def get_person_movies(self, person, limit=1000, countries=None, languages=None, genres=None, def get_person_movies(self, person, limit=1000, years=None, countries=None, languages=None, genres=None,
include_non_acting_roles=False): include_non_acting_roles=False):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/people/%s/movies' % person.replace(' ', '-').lower(), url='https://api.trakt.tv/people/%s/movies' % person.replace(' ', '-').lower(),
object_name='movies', object_name='movies',
type_name='person', type_name='person',
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
@ -575,65 +600,75 @@ class Trakt:
) )
@cache(cache_file=cachefile, retry_if_blank=True) @cache(cache_file=cachefile, retry_if_blank=True)
def get_most_played_movies(self, limit=1000, countries=None, languages=None, genres=None, most_type=None): def get_most_played_movies(self, limit=1000, years=None, countries=None, languages=None, genres=None,
most_type=None):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/movies/played/%s' % ('weekly' if not most_type else most_type), url='https://api.trakt.tv/movies/played/%s' % ('weekly' if not most_type else most_type),
object_name='movies', object_name='movies',
type_name='played', type_name='played',
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
) )
@cache(cache_file=cachefile, retry_if_blank=True) @cache(cache_file=cachefile, retry_if_blank=True)
def get_most_watched_movies(self, limit=1000, countries=None, languages=None, genres=None, most_type=None): def get_most_watched_movies(self, limit=1000, years=None, countries=None, languages=None, genres=None,
most_type=None):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/movies/watched/%s' % ('weekly' if not most_type else most_type), url='https://api.trakt.tv/movies/watched/%s' % ('weekly' if not most_type else most_type),
object_name='movies', object_name='movies',
type_name='watched', type_name='watched',
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
) )
def get_boxoffice_movies(self, limit=1000, countries=None, languages=None, genres=None): def get_boxoffice_movies(self, limit=1000, years=None, countries=None, languages=None, genres=None):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/movies/boxoffice', url='https://api.trakt.tv/movies/boxoffice',
object_name='movies', object_name='movies',
type_name='anticipated', type_name='anticipated',
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
) )
def get_recommended_movies(self, authenticate_user=None, limit=1000, countries=None, languages=None, genres=None): def get_recommended_movies(self, authenticate_user=None, limit=1000, years=None, countries=None, languages=None,
genres=None):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/recommendations/movies', url='https://api.trakt.tv/recommendations/movies',
object_name='movies', object_name='movies',
type_name='recommended from {authenticate_user}', type_name='recommended from {authenticate_user}',
authenticate_user=authenticate_user, authenticate_user=authenticate_user,
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
) )
def get_watchlist_movies(self, authenticate_user=None, limit=1000, countries=None, languages=None): def get_watchlist_movies(self, authenticate_user=None, limit=1000, years=None, countries=None, languages=None,
genres=None):
return self._make_items_request( return self._make_items_request(
url='https://api.trakt.tv/users/{authenticate_user}/watchlist/movies', url='https://api.trakt.tv/users/{authenticate_user}/watchlist/movies',
object_name='movies', object_name='movies',
type_name='watchlist from {authenticate_user}', type_name='watchlist from {authenticate_user}',
authenticate_user=authenticate_user, authenticate_user=authenticate_user,
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,
) )
def get_user_list_movies(self, list_url, authenticate_user=None, limit=1000, countries=None, languages=None): def get_user_list_movies(self, list_url, authenticate_user=None, limit=1000, years=None, countries=None,
languages=None, genres=None):
list_user, list_key = extract_list_user_and_key_from_url(list_url) list_user, list_key = extract_list_user_and_key_from_url(list_url)
log.debug('Fetching %s from %s', list_key, list_user) log.debug('Fetching %s from %s', list_key, list_user)
@ -644,6 +679,7 @@ class Trakt:
type_name=(list_key + ' from ' + list_user), type_name=(list_key + ' from ' + list_user),
authenticate_user=authenticate_user, authenticate_user=authenticate_user,
limit=limit, limit=limit,
years=years,
countries=countries, countries=countries,
languages=languages, languages=languages,
genres=genres, genres=genres,

@ -353,6 +353,12 @@ def shows(list_type, add_limit=0, add_delay=2.5, sort='votes', genres=None, fold
misc_helper.unblacklist_genres(genres, cfg['filters']['shows']['blacklisted_genres']) misc_helper.unblacklist_genres(genres, cfg['filters']['shows']['blacklisted_genres'])
log.debug("Filter Trakt results with genre(s): %s", ', '.join(map(lambda x: x.title(), genres.split(',')))) log.debug("Filter Trakt results with genre(s): %s", ', '.join(map(lambda x: x.title(), genres.split(','))))
# set years range
if cfg.filters.shows.blacklisted_min_year and cfg.filters.shows.blacklisted_max_year:
years = str(cfg.filters.shows.blacklisted_min_year) + '-' + str(cfg.filters.shows.blacklisted_max_year)
else:
years = None
# replace sonarr root_folder if folder is supplied # replace sonarr root_folder if folder is supplied
if folder: if folder:
cfg['sonarr']['root_folder'] = folder cfg['sonarr']['root_folder'] = folder
@ -377,6 +383,7 @@ def shows(list_type, add_limit=0, add_delay=2.5, sort='votes', genres=None, fold
# 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(
years=years,
countries=cfg.filters.shows.allowed_countries, countries=cfg.filters.shows.allowed_countries,
languages=cfg.filters.shows.allowed_languages, languages=cfg.filters.shows.allowed_languages,
genres=genres, genres=genres,
@ -384,6 +391,7 @@ def shows(list_type, add_limit=0, add_delay=2.5, sort='votes', genres=None, fold
elif list_type.lower() == 'trending': elif list_type.lower() == 'trending':
trakt_objects_list = trakt.get_trending_shows( trakt_objects_list = trakt.get_trending_shows(
years=years,
countries=cfg.filters.shows.allowed_countries, countries=cfg.filters.shows.allowed_countries,
languages=cfg.filters.shows.allowed_languages, languages=cfg.filters.shows.allowed_languages,
genres=genres, genres=genres,
@ -391,6 +399,7 @@ def shows(list_type, add_limit=0, add_delay=2.5, sort='votes', genres=None, fold
elif list_type.lower() == 'popular': elif list_type.lower() == 'popular':
trakt_objects_list = trakt.get_popular_shows( trakt_objects_list = trakt.get_popular_shows(
years=years,
countries=cfg.filters.shows.allowed_countries, countries=cfg.filters.shows.allowed_countries,
languages=cfg.filters.shows.allowed_languages, languages=cfg.filters.shows.allowed_languages,
genres=genres, genres=genres,
@ -402,6 +411,7 @@ def shows(list_type, add_limit=0, add_delay=2.5, sort='votes', genres=None, fold
" list type!") " list type!")
return None return None
trakt_objects_list = trakt.get_person_shows( trakt_objects_list = trakt.get_person_shows(
years=years,
person=actor, person=actor,
countries=cfg.filters.shows.allowed_countries, countries=cfg.filters.shows.allowed_countries,
languages=cfg.filters.shows.allowed_languages, languages=cfg.filters.shows.allowed_languages,
@ -412,6 +422,7 @@ def shows(list_type, add_limit=0, add_delay=2.5, sort='votes', genres=None, fold
elif list_type.lower() == 'recommended': elif list_type.lower() == 'recommended':
trakt_objects_list = trakt.get_recommended_shows( trakt_objects_list = trakt.get_recommended_shows(
authenticate_user, authenticate_user,
years=years,
countries=cfg.filters.shows.allowed_countries, countries=cfg.filters.shows.allowed_countries,
languages=cfg.filters.shows.allowed_languages, languages=cfg.filters.shows.allowed_languages,
genres=genres, genres=genres,
@ -420,6 +431,7 @@ def shows(list_type, add_limit=0, add_delay=2.5, sort='votes', genres=None, fold
elif list_type.lower().startswith('played'): elif list_type.lower().startswith('played'):
most_type = misc_helper.substring_after(list_type.lower(), "_") most_type = misc_helper.substring_after(list_type.lower(), "_")
trakt_objects_list = trakt.get_most_played_shows( trakt_objects_list = trakt.get_most_played_shows(
years=years,
countries=cfg.filters.shows.allowed_countries, countries=cfg.filters.shows.allowed_countries,
languages=cfg.filters.shows.allowed_languages, languages=cfg.filters.shows.allowed_languages,
genres=genres, genres=genres,
@ -429,6 +441,7 @@ def shows(list_type, add_limit=0, add_delay=2.5, sort='votes', genres=None, fold
elif list_type.lower().startswith('watched'): elif list_type.lower().startswith('watched'):
most_type = misc_helper.substring_after(list_type.lower(), "_") most_type = misc_helper.substring_after(list_type.lower(), "_")
trakt_objects_list = trakt.get_most_watched_shows( trakt_objects_list = trakt.get_most_watched_shows(
years=years,
countries=cfg.filters.shows.allowed_countries, countries=cfg.filters.shows.allowed_countries,
languages=cfg.filters.shows.allowed_languages, languages=cfg.filters.shows.allowed_languages,
genres=genres, genres=genres,
@ -769,6 +782,12 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rotten_tomatoes=
misc_helper.unblacklist_genres(genres, cfg['filters']['movies']['blacklisted_genres']) misc_helper.unblacklist_genres(genres, cfg['filters']['movies']['blacklisted_genres'])
log.debug("Filter Trakt results with genre(s): %s", ', '.join(map(lambda x: x.title(), genres))) log.debug("Filter Trakt results with genre(s): %s", ', '.join(map(lambda x: x.title(), genres)))
# set years range
if cfg.filters.movies.blacklisted_min_year and cfg.filters.movies.blacklisted_max_year:
years = str(cfg.filters.movies.blacklisted_min_year) + '-' + str(cfg.filters.movies.blacklisted_max_year)
else:
years = None
# replace radarr root_folder if folder is supplied # replace radarr root_folder if folder is supplied
if folder: if folder:
cfg['radarr']['root_folder'] = folder cfg['radarr']['root_folder'] = folder
@ -800,6 +819,7 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rotten_tomatoes=
# 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(
years=years,
countries=cfg.filters.shows.allowed_countries, countries=cfg.filters.shows.allowed_countries,
languages=cfg.filters.shows.allowed_languages, languages=cfg.filters.shows.allowed_languages,
genres=genres, genres=genres,
@ -807,6 +827,7 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rotten_tomatoes=
elif list_type.lower() == 'trending': elif list_type.lower() == 'trending':
trakt_objects_list = trakt.get_trending_movies( trakt_objects_list = trakt.get_trending_movies(
years=years,
countries=cfg.filters.shows.allowed_countries, countries=cfg.filters.shows.allowed_countries,
languages=cfg.filters.shows.allowed_languages, languages=cfg.filters.shows.allowed_languages,
genres=genres, genres=genres,
@ -814,6 +835,7 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rotten_tomatoes=
elif list_type.lower() == 'popular': elif list_type.lower() == 'popular':
trakt_objects_list = trakt.get_popular_movies( trakt_objects_list = trakt.get_popular_movies(
years=years,
countries=cfg.filters.shows.allowed_countries, countries=cfg.filters.shows.allowed_countries,
languages=cfg.filters.shows.allowed_languages, languages=cfg.filters.shows.allowed_languages,
genres=genres, genres=genres,
@ -821,6 +843,7 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rotten_tomatoes=
elif list_type.lower() == 'boxoffice': elif list_type.lower() == 'boxoffice':
trakt_objects_list = trakt.get_boxoffice_movies( trakt_objects_list = trakt.get_boxoffice_movies(
years=years,
countries=cfg.filters.shows.allowed_countries, countries=cfg.filters.shows.allowed_countries,
languages=cfg.filters.shows.allowed_languages, languages=cfg.filters.shows.allowed_languages,
genres=genres, genres=genres,
@ -832,6 +855,7 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rotten_tomatoes=
" list type!") " list type!")
return None return None
trakt_objects_list = trakt.get_person_movies( trakt_objects_list = trakt.get_person_movies(
years=years,
person=actor, person=actor,
countries=cfg.filters.shows.allowed_countries, countries=cfg.filters.shows.allowed_countries,
languages=cfg.filters.shows.allowed_languages, languages=cfg.filters.shows.allowed_languages,
@ -842,6 +866,7 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rotten_tomatoes=
elif list_type.lower() == 'recommended': elif list_type.lower() == 'recommended':
trakt_objects_list = trakt.get_recommended_movies( trakt_objects_list = trakt.get_recommended_movies(
authenticate_user, authenticate_user,
years=years,
countries=cfg.filters.shows.allowed_countries, countries=cfg.filters.shows.allowed_countries,
languages=cfg.filters.shows.allowed_languages, languages=cfg.filters.shows.allowed_languages,
genres=genres, genres=genres,
@ -850,6 +875,7 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rotten_tomatoes=
elif list_type.lower().startswith('played'): elif list_type.lower().startswith('played'):
most_type = misc_helper.substring_after(list_type.lower(), "_") most_type = misc_helper.substring_after(list_type.lower(), "_")
trakt_objects_list = trakt.get_most_played_movies( trakt_objects_list = trakt.get_most_played_movies(
years=years,
countries=cfg.filters.shows.allowed_countries, countries=cfg.filters.shows.allowed_countries,
languages=cfg.filters.shows.allowed_languages, languages=cfg.filters.shows.allowed_languages,
genres=genres, genres=genres,
@ -859,6 +885,7 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rotten_tomatoes=
elif list_type.lower().startswith('watched'): elif list_type.lower().startswith('watched'):
most_type = misc_helper.substring_after(list_type.lower(), "_") most_type = misc_helper.substring_after(list_type.lower(), "_")
trakt_objects_list = trakt.get_most_watched_movies( trakt_objects_list = trakt.get_most_watched_movies(
years=years,
countries=cfg.filters.shows.allowed_countries, countries=cfg.filters.shows.allowed_countries,
languages=cfg.filters.shows.allowed_languages, languages=cfg.filters.shows.allowed_languages,
genres=genres, genres=genres,

Loading…
Cancel
Save