Trakt: Skip empty custom Trakt lists

pull/105/head
desimaniac 5 years ago
parent 12010bd58b
commit 9926555d0f

@ -1160,6 +1160,11 @@ def automatic_shows(add_delay=2.5, sort='votes', no_search=False, notifications=
notifications=notifications, authenticate_user=authenticate_user, notifications=notifications, authenticate_user=authenticate_user,
ignore_blacklist=local_ignore_blacklist) ignore_blacklist=local_ignore_blacklist)
elif list_type.lower() == 'lists': elif list_type.lower() == 'lists':
if len(value.items()) == 0:
log.info("SKIPPED Trakt's \'%s\' shows list", list_type.capitalize())
continue
for list_, v in value.items(): for list_, v in value.items():
if isinstance(v, dict): if isinstance(v, dict):
authenticate_user = v['authenticate_user'] authenticate_user = v['authenticate_user']
@ -1168,6 +1173,10 @@ def automatic_shows(add_delay=2.5, sort='votes', no_search=False, notifications=
authenticate_user = None authenticate_user = None
limit = v limit = v
if limit <= 0:
log.info("SKIPPED Trakt's \'%s\' shows list", list_)
continue
local_ignore_blacklist = ignore_blacklist local_ignore_blacklist = ignore_blacklist
if "list:%s".format(list_) in cfg.filters.shows.disabled_for: if "list:%s".format(list_) in cfg.filters.shows.disabled_for:
@ -1180,7 +1189,8 @@ def automatic_shows(add_delay=2.5, sort='votes', no_search=False, notifications=
ignore_blacklist=local_ignore_blacklist) ignore_blacklist=local_ignore_blacklist)
if added_shows is None: if added_shows is None:
log.error("FAILED ADDING shows from Trakt's \'%s\' list", list_type) if not list_type.lower() == 'lists':
log.error("FAILED ADDING shows from Trakt's \'%s\' list", list_type)
time.sleep(10) time.sleep(10)
continue continue
total_shows_added += added_shows total_shows_added += added_shows
@ -1258,6 +1268,11 @@ def automatic_movies(add_delay=2.5, sort='votes', no_search=False, notifications
ignore_blacklist=local_ignore_blacklist, ignore_blacklist=local_ignore_blacklist,
rotten_tomatoes=rotten_tomatoes) rotten_tomatoes=rotten_tomatoes)
elif list_type.lower() == 'lists': elif list_type.lower() == 'lists':
if len(value.items()) == 0:
log.info("SKIPPED Trakt's \'%s\' movies list", list_type.capitalize())
continue
for list_, v in value.items(): for list_, v in value.items():
if isinstance(v, dict): if isinstance(v, dict):
authenticate_user = v['authenticate_user'] authenticate_user = v['authenticate_user']
@ -1266,6 +1281,10 @@ def automatic_movies(add_delay=2.5, sort='votes', no_search=False, notifications
authenticate_user = None authenticate_user = None
limit = v limit = v
if limit <= 0:
log.info("SKIPPED Trakt's \'%s\' movies list", list_)
continue
local_ignore_blacklist = ignore_blacklist local_ignore_blacklist = ignore_blacklist
if "list:%s".format(list_) in cfg.filters.movies.disabled_for: if "list:%s".format(list_) in cfg.filters.movies.disabled_for:
@ -1279,7 +1298,8 @@ def automatic_movies(add_delay=2.5, sort='votes', no_search=False, notifications
rotten_tomatoes=rotten_tomatoes) rotten_tomatoes=rotten_tomatoes)
if added_movies is None: if added_movies is None:
log.error("FAILED ADDING movies from Trakt's \'%s\' list", list_type.capitalize()) if not list_type.lower() == 'lists':
log.error("FAILED ADDING movies from Trakt's \'%s\' list", list_type.capitalize())
time.sleep(10) time.sleep(10)
continue continue
total_movies_added += added_movies total_movies_added += added_movies

Loading…
Cancel
Save