|
|
@ -97,7 +97,7 @@ def blacklisted_show_country(show, allowed_countries):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
# ["ignore"] - add show item even if it is missing a country
|
|
|
|
# ["ignore"] - add show item even if it is missing a country
|
|
|
|
if len(allowed_countries) == 1 and allowed_countries[0].lower() == 'ignore':
|
|
|
|
if len(allowed_countries) == 1 and allowed_countries[0].lower() == 'ignore':
|
|
|
|
log.debug("\'%s\' | Blacklisted Countries Check | Ignoring valid countries check.", show['show']['title'])
|
|
|
|
log.debug("\'%s\' | Blacklisted Countries Check | Ignored.", show['show']['title'])
|
|
|
|
# List provided - skip adding show item because it is missing a country
|
|
|
|
# List provided - skip adding show item because it is missing a country
|
|
|
|
elif not show['show']['country']:
|
|
|
|
elif not show['show']['country']:
|
|
|
|
log.debug("\'%s\' | Blacklisted Countries Check | Blacklisted because it had no country specified.",
|
|
|
|
log.debug("\'%s\' | Blacklisted Countries Check | Blacklisted because it had no country specified.",
|
|
|
@ -105,7 +105,7 @@ def blacklisted_show_country(show, allowed_countries):
|
|
|
|
blacklisted = True
|
|
|
|
blacklisted = True
|
|
|
|
# [] - add show item from any valid country
|
|
|
|
# [] - add show item from any valid country
|
|
|
|
elif not allowed_countries:
|
|
|
|
elif not allowed_countries:
|
|
|
|
log.debug("\'%s\' | Blacklisted Countries Check | Skipping allowed countries check.",
|
|
|
|
log.debug("\'%s\' | Blacklisted Countries Check | Skipped.",
|
|
|
|
show['show']['title'])
|
|
|
|
show['show']['title'])
|
|
|
|
# List provided - skip adding show item if the country is blacklisted
|
|
|
|
# List provided - skip adding show item if the country is blacklisted
|
|
|
|
elif not any(show['show']['country'].lower() in s.lower() for s in allowed_countries):
|
|
|
|
elif not any(show['show']['country'].lower() in s.lower() for s in allowed_countries):
|
|
|
@ -128,7 +128,7 @@ def blacklisted_show_language(show, allowed_languages):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
# ["ignore"] - add show item even if it is missing a language
|
|
|
|
# ["ignore"] - add show item even if it is missing a language
|
|
|
|
if len(allowed_languages) == 1 and allowed_languages[0].lower() == 'ignore':
|
|
|
|
if len(allowed_languages) == 1 and allowed_languages[0].lower() == 'ignore':
|
|
|
|
log.debug("\'%s\' | Blacklisted Languages Check | Ignoring valid languages check.", show['show']['title'])
|
|
|
|
log.debug("\'%s\' | Blacklisted Languages Check | Ignored.", show['show']['title'])
|
|
|
|
# List provided - skip adding show item because it is missing a language
|
|
|
|
# List provided - skip adding show item because it is missing a language
|
|
|
|
elif not show['show']['language']:
|
|
|
|
elif not show['show']['language']:
|
|
|
|
log.debug("\'%s\' | Blacklisted Languages Check | Blacklisted because it had no language specified.",
|
|
|
|
log.debug("\'%s\' | Blacklisted Languages Check | Blacklisted because it had no language specified.",
|
|
|
@ -151,14 +151,14 @@ def blacklisted_show_genre(show, genres):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
# ["ignore"] - add show item even if it is missing a genre
|
|
|
|
# ["ignore"] - add show item even if it is missing a genre
|
|
|
|
if len(genres) == 1 and genres[0].lower() == 'ignore':
|
|
|
|
if len(genres) == 1 and genres[0].lower() == 'ignore':
|
|
|
|
log.debug("\'%s\' | Blacklisted Genres Check | Ignoring valid genres check.", show['show']['title'])
|
|
|
|
log.debug("\'%s\' | Blacklisted Genres Check | Ignored.", show['show']['title'])
|
|
|
|
elif not show['show']['genres']:
|
|
|
|
elif not show['show']['genres']:
|
|
|
|
log.debug("\'%s\' | Blacklisted Genres Check | Blacklisted because it had no genre specified.",
|
|
|
|
log.debug("\'%s\' | Blacklisted Genres Check | Blacklisted because it had no genre specified.",
|
|
|
|
show['show']['title'])
|
|
|
|
show['show']['title'])
|
|
|
|
blacklisted = True
|
|
|
|
blacklisted = True
|
|
|
|
# [] - add show item with any valid genre
|
|
|
|
# [] - add show item with any valid genre
|
|
|
|
elif not genres:
|
|
|
|
elif not genres:
|
|
|
|
log.debug("\'%s\' | Blacklisted Genres Check | Skipping blacklisted genres check.",
|
|
|
|
log.debug("\'%s\' | Blacklisted Genres Check | Skipped.",
|
|
|
|
show['show']['title'])
|
|
|
|
show['show']['title'])
|
|
|
|
# List provided - skip adding show item if the genre is blacklisted
|
|
|
|
# List provided - skip adding show item if the genre is blacklisted
|
|
|
|
else:
|
|
|
|
else:
|
|
|
@ -283,7 +283,7 @@ def blacklisted_movie_country(movie, allowed_countries):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
# ["ignore"] - add movie item even if it is missing a country
|
|
|
|
# ["ignore"] - add movie item even if it is missing a country
|
|
|
|
if len(allowed_countries) == 1 and allowed_countries[0].lower() == 'ignore':
|
|
|
|
if len(allowed_countries) == 1 and allowed_countries[0].lower() == 'ignore':
|
|
|
|
log.debug("\'%s\' | Blacklisted Countries Check | Ignoring valid countries check.",
|
|
|
|
log.debug("\'%s\' | Blacklisted Countries Check | Ignored.",
|
|
|
|
movie['movie']['title'])
|
|
|
|
movie['movie']['title'])
|
|
|
|
# List provided - skip adding movie item because it is missing a country
|
|
|
|
# List provided - skip adding movie item because it is missing a country
|
|
|
|
elif not movie['movie']['country']:
|
|
|
|
elif not movie['movie']['country']:
|
|
|
@ -292,7 +292,7 @@ def blacklisted_movie_country(movie, allowed_countries):
|
|
|
|
blacklisted = True
|
|
|
|
blacklisted = True
|
|
|
|
# [] - add movie item with from any valid country
|
|
|
|
# [] - add movie item with from any valid country
|
|
|
|
elif not allowed_countries:
|
|
|
|
elif not allowed_countries:
|
|
|
|
log.debug("\'%s\' | Blacklisted Countries Check | Skipping allowed countries check.",
|
|
|
|
log.debug("\'%s\' | Blacklisted Countries Check | Skipped.",
|
|
|
|
movie['movie']['title'])
|
|
|
|
movie['movie']['title'])
|
|
|
|
# List provided - skip adding movie item if the country is blacklisted
|
|
|
|
# List provided - skip adding movie item if the country is blacklisted
|
|
|
|
elif not any(movie['movie']['country'].lower() in s.lower() for s in allowed_countries):
|
|
|
|
elif not any(movie['movie']['country'].lower() in s.lower() for s in allowed_countries):
|
|
|
@ -314,7 +314,7 @@ def blacklisted_movie_language(movie, allowed_languages):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
# ["ignore"] - add movie item even if it is missing a language
|
|
|
|
# ["ignore"] - add movie item even if it is missing a language
|
|
|
|
if len(allowed_languages) == 1 and allowed_languages[0].lower() == 'ignore':
|
|
|
|
if len(allowed_languages) == 1 and allowed_languages[0].lower() == 'ignore':
|
|
|
|
log.debug("\'%s\' | Blacklisted Languages Check | Ignoring valid languages check.",
|
|
|
|
log.debug("\'%s\' | Blacklisted Languages Check | Ignored.",
|
|
|
|
movie['movie']['title'])
|
|
|
|
movie['movie']['title'])
|
|
|
|
# List provided - skip adding movie item because it is missing a language
|
|
|
|
# List provided - skip adding movie item because it is missing a language
|
|
|
|
elif not movie['movie']['language']:
|
|
|
|
elif not movie['movie']['language']:
|
|
|
@ -338,14 +338,14 @@ def blacklisted_movie_genre(movie, genres):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
# ["ignore"] - add movie item even if it is missing a genre
|
|
|
|
# ["ignore"] - add movie item even if it is missing a genre
|
|
|
|
if len(genres) == 1 and genres[0].lower() == 'ignore':
|
|
|
|
if len(genres) == 1 and genres[0].lower() == 'ignore':
|
|
|
|
log.debug("\'%s\' | Blacklisted Genres Check | Ignoring valid genres check.", movie['movie']['title'])
|
|
|
|
log.debug("\'%s\' | Blacklisted Genres Check | Ignored.", movie['movie']['title'])
|
|
|
|
elif not movie['movie']['genres']:
|
|
|
|
elif not movie['movie']['genres']:
|
|
|
|
log.debug("\'%s\' | Blacklisted Genres Check | Blacklisted because it had no genre specified.",
|
|
|
|
log.debug("\'%s\' | Blacklisted Genres Check | Blacklisted because it had no genre specified.",
|
|
|
|
movie['movie']['title'])
|
|
|
|
movie['movie']['title'])
|
|
|
|
blacklisted = True
|
|
|
|
blacklisted = True
|
|
|
|
# [] - add movie item with any valid genre
|
|
|
|
# [] - add movie item with any valid genre
|
|
|
|
elif not genres:
|
|
|
|
elif not genres:
|
|
|
|
log.debug("\'%s\' | Blacklisted Genres Check | Skipping blacklisted genres check.",
|
|
|
|
log.debug("\'%s\' | Blacklisted Genres Check | Skipped.",
|
|
|
|
movie['movie']['title'])
|
|
|
|
movie['movie']['title'])
|
|
|
|
# List provided - skip adding movie item if the genre is blacklisted
|
|
|
|
# List provided - skip adding movie item if the genre is blacklisted
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|