Shows: Added support for blacklisted_title_keywords

pull/105/head
desimaniac 5 years ago
parent 80e25e756a
commit ac08098a16

@ -249,19 +249,19 @@ You can repeat this process for as many users as you like.
"allowed_languages": [ "allowed_languages": [
"en" "en"
], ],
"blacklist_title_keywords": [
"untitled",
"barbie",
"ufc"
],
"blacklisted_genres": [ "blacklisted_genres": [
"documentary", "documentary",
"music", "music",
"animation" "animation"
], ],
"blacklisted_max_year": 2019,
"blacklisted_min_runtime": 60, "blacklisted_min_runtime": 60,
"blacklisted_max_year": 2019,
"blacklisted_min_year": 2000, "blacklisted_min_year": 2000,
"blacklisted_title_keywords": [
"untitled",
"barbie",
"ufc"
],
"blacklisted_tmdb_ids": [], "blacklisted_tmdb_ids": [],
"rotten_tomatoes": "" "rotten_tomatoes": ""
}, },
@ -285,9 +285,6 @@ You can repeat this process for as many users as you like.
"documentary", "documentary",
"special-interest" "special-interest"
], ],
"blacklisted_max_year": 2019,
"blacklisted_min_runtime": 15,
"blacklisted_min_year": 2000,
"blacklisted_networks": [ "blacklisted_networks": [
"twitch", "twitch",
"youtube", "youtube",
@ -304,6 +301,10 @@ You can repeat this process for as many users as you like.
"yahoo!", "yahoo!",
"fox sports" "fox sports"
], ],
"blacklisted_max_year": 2019,
"blacklisted_min_runtime": 15,
"blacklisted_min_year": 2000,
"blacklisted_title_keywords": [],
"blacklisted_tvdb_ids": [] "blacklisted_tvdb_ids": []
} }
}, },
@ -536,10 +537,6 @@ Use filters to specify the movie/shows's country of origin or blacklist (i.e. fi
"ca" "ca"
], ],
"allowed_languages": [], "allowed_languages": [],
"blacklist_title_keywords": [
"untitled",
"barbie"
],
"blacklisted_genres": [ "blacklisted_genres": [
"documentary", "documentary",
"music", "music",
@ -548,6 +545,10 @@ Use filters to specify the movie/shows's country of origin or blacklist (i.e. fi
"blacklisted_max_year": 2019, "blacklisted_max_year": 2019,
"blacklisted_min_runtime": 60, "blacklisted_min_runtime": 60,
"blacklisted_min_year": 2000, "blacklisted_min_year": 2000,
"blacklisted_title_keywords": [
"untitled",
"barbie"
],
"blacklisted_tmdb_ids": [], "blacklisted_tmdb_ids": [],
"rotten_tomatoes": "" "rotten_tomatoes": ""
}, },
@ -587,8 +588,6 @@ Use filters to specify the movie/shows's country of origin or blacklist (i.e. fi
- [List of available language codes](assets/list_of_language_codes.md). - [List of available language codes](assets/list_of_language_codes.md).
`blacklist_title_keywords` - blacklist certain words in titles.
`blacklisted_genres` - Blacklist certain genres. `blacklisted_genres` - Blacklist certain genres.
- [List of available movie genres](assets/list_of_movie_genres.md). - [List of available movie genres](assets/list_of_movie_genres.md).
@ -609,6 +608,8 @@ Use filters to specify the movie/shows's country of origin or blacklist (i.e. fi
`blacklisted_min_year` - Blacklist release dates before specified year. `blacklisted_min_year` - Blacklist release dates before specified year.
`blacklisted_title_keywords` - Blacklist certain words in titles.
`blacklisted_tmdb_ids` - Blacklist certain movies with their TMDB IDs. `blacklisted_tmdb_ids` - Blacklist certain movies with their TMDB IDs.
- Example: - Example:
@ -644,9 +645,6 @@ Use filters to specify the movie/shows's country of origin or blacklist (i.e. fi
"documentary", "documentary",
"special-interest" "special-interest"
], ],
"blacklisted_max_year": 2019,
"blacklisted_min_runtime": 15,
"blacklisted_min_year": 2000,
"blacklisted_networks": [ "blacklisted_networks": [
"twitch", "twitch",
"youtube", "youtube",
@ -663,6 +661,10 @@ Use filters to specify the movie/shows's country of origin or blacklist (i.e. fi
"yahoo!", "yahoo!",
"fox sports" "fox sports"
], ],
"blacklisted_min_runtime": 15,
"blacklisted_max_year": 2019,
"blacklisted_min_year": 2000,
"blacklisted_title_keywords": [],
"blacklisted_tvdb_ids": [] "blacklisted_tvdb_ids": []
} }
``` ```
@ -715,13 +717,15 @@ Use filters to specify the movie/shows's country of origin or blacklist (i.e. fi
- No other list item should be present. - No other list item should be present.
`blacklisted_max_year` - Blacklist release dates after specified year. `blacklisted_networks` - Blacklist certain network.
`blacklisted_min_runtime` - Blacklist runtime duration lower than specified time (in minutes). `blacklisted_min_runtime` - Blacklist runtime duration lower than specified time (in minutes).
`blacklisted_max_year` - Blacklist release dates after specified year.
`blacklisted_min_year` - Blacklist release dates before specified year. `blacklisted_min_year` - Blacklist release dates before specified year.
`blacklisted_networks` - Blacklist certain network. `blacklisted_title_keywords` - Blacklist certain words in titles.
`blacklisted_tvdb_ids` - Blacklist certain shows with their TVDB IDs. `blacklisted_tvdb_ids` - Blacklist certain shows with their TVDB IDs.

@ -32,12 +32,19 @@ def blacklisted_show_id(show, blacklisted_ids):
return blacklisted return blacklisted
def blacklisted_show_title(show): def blacklisted_show_title(show, blacklisted_keywords):
blacklisted = False blacklisted = False
try: try:
if not show['show']['title']: if not show['show']['title']:
log.debug("Blacklisted Titles Check | Blacklisted show because it had no title: %s", show) log.debug("Blacklisted Titles Check | Blacklisted show because it had no title: %s", show)
blacklisted = True blacklisted = True
else:
for keyword in blacklisted_keywords:
if keyword.lower() in show['show']['title'].lower():
log.debug("\'%s\' | Blacklisted Titles Check | Blacklisted because it had the title keyword: %s",
show['show']['title'], keyword)
blacklisted = True
break
except Exception: except Exception:
log.exception("Exception determining if show had a blacklisted title %s: ", show) log.exception("Exception determining if show had a blacklisted title %s: ", show)
return blacklisted return blacklisted
@ -194,7 +201,7 @@ def is_show_blacklisted(show, blacklist_settings, ignore_blacklist, callback=Non
try: try:
if blacklisted_show_id(show, blacklist_settings.blacklisted_tvdb_ids): if blacklisted_show_id(show, blacklist_settings.blacklisted_tvdb_ids):
blacklisted = True blacklisted = True
if blacklisted_show_title(show): if blacklisted_show_title(show, blacklist_settings.blacklisted_title_keywords):
blacklisted = True blacklisted = True
if blacklisted_show_year(show, blacklist_settings.blacklisted_min_year, if blacklisted_show_year(show, blacklist_settings.blacklisted_min_year,
blacklist_settings.blacklisted_max_year): blacklist_settings.blacklisted_max_year):
@ -240,7 +247,7 @@ def blacklisted_movie_title(movie, blacklisted_keywords):
else: else:
for keyword in blacklisted_keywords: for keyword in blacklisted_keywords:
if keyword.lower() in movie['movie']['title'].lower(): if keyword.lower() in movie['movie']['title'].lower():
log.debug("\'%s\' | Blacklisted Titles Check | Blacklisted because it had title keyword: %s", log.debug("\'%s\' | Blacklisted Titles Check | Blacklisted because it had the title keyword: %s",
movie['movie']['title'], keyword) movie['movie']['title'], keyword)
blacklisted = True blacklisted = True
break break
@ -381,7 +388,7 @@ def is_movie_blacklisted(movie, blacklist_settings, ignore_blacklist, callback=N
try: try:
if blacklisted_movie_id(movie, blacklist_settings.blacklisted_tmdb_ids): if blacklisted_movie_id(movie, blacklist_settings.blacklisted_tmdb_ids):
blacklisted = True blacklisted = True
if blacklisted_movie_title(movie, blacklist_settings.blacklist_title_keywords): if blacklisted_movie_title(movie, blacklist_settings.blacklisted_title_keywords):
blacklisted = True blacklisted = True
if blacklisted_movie_year(movie, blacklist_settings.blacklisted_min_year, if blacklisted_movie_year(movie, blacklist_settings.blacklisted_min_year,
blacklist_settings.blacklisted_max_year): blacklist_settings.blacklisted_max_year):

@ -62,25 +62,26 @@ class Config(object, metaclass=Singleton):
'filters': { 'filters': {
'shows': { 'shows': {
'disabled_for': [], 'disabled_for': [],
'blacklisted_genres': [],
'blacklisted_networks': [],
'allowed_countries': [], 'allowed_countries': [],
'allowed_languages': [], 'allowed_languages': [],
'blacklisted_genres': [],
'blacklisted_networks': [],
'blacklisted_min_runtime': 15, 'blacklisted_min_runtime': 15,
'blacklisted_min_year': 2000, 'blacklisted_min_year': 2000,
'blacklisted_max_year': 2019, 'blacklisted_max_year': 2019,
'blacklisted_title_keywords': [],
'blacklisted_tvdb_ids': [], 'blacklisted_tvdb_ids': [],
}, },
'movies': { 'movies': {
'disabled_for': [], 'disabled_for': [],
'allowed_countries': [],
'allowed_languages': [],
'blacklisted_genres': [], 'blacklisted_genres': [],
'blacklisted_min_runtime': 60, 'blacklisted_min_runtime': 60,
'blacklisted_min_year': 2000, 'blacklisted_min_year': 2000,
'blacklisted_max_year': 2019, 'blacklisted_max_year': 2019,
'blacklist_title_keywords': [], 'blacklisted_title_keywords': [],
'blacklisted_tmdb_ids': [], 'blacklisted_tmdb_ids': [],
'allowed_countries': [],
'allowed_languages': [],
'rotten_tomatoes': "" 'rotten_tomatoes': ""
} }
}, },

@ -21,16 +21,42 @@
"verbose": false "verbose": false
}, },
"filters": { "filters": {
"movies": {
"disabled_for": [],
"allowed_countries": [
"us",
"gb",
"ca"
],
"allowed_languages": [
"en"
],
"blacklisted_genres": [
"documentary",
"music",
"short",
"sporting-event",
"film-noir",
"fan-film"
],
"blacklisted_min_runtime": 60,
"blacklisted_min_year": 2000,
"blacklisted_max_year": 2019,
"blacklisted_title_keywords": [
"untitled",
"barbie",
"ufc"
],
"rotten_tomatoes": 80
},
"shows": { "shows": {
"disabled_for": [],
"allowed_countries": [ "allowed_countries": [
"us", "us",
"gb", "gb",
"ca" "ca"
], ],
"allowed_languages": [], "allowed_languages": [],
"blacklisted_min_runtime": 15,
"blacklisted_min_year": 2010,
"blacklisted_max_year": 2019,
"blacklisted_genres": [ "blacklisted_genres": [
"animation", "animation",
"game-show", "game-show",
@ -59,35 +85,10 @@
"fox sports", "fox sports",
"yahoo!" "yahoo!"
], ],
"disabled_for": [] "blacklisted_min_runtime": 15,
}, "blacklisted_min_year": 2010,
"movies": {
"allowed_countries": [
"us",
"gb",
"ca"
],
"allowed_languages": [
"en"
],
"blacklisted_genres": [
"documentary",
"music",
"short",
"sporting-event",
"film-noir",
"fan-film"
],
"blacklist_title_keywords": [
"untitled",
"barbie",
"ufc"
],
"blacklisted_min_runtime": 60,
"blacklisted_min_year": 2000,
"blacklisted_max_year": 2019, "blacklisted_max_year": 2019,
"rotten_tomatoes": 80, "blacklisted_title_keywords": []
"disabled_for": []
} }
}, },
"radarr": { "radarr": {

@ -52,6 +52,8 @@ def app(config, cachefile, logfile):
cfg = Config(configfile=config, cachefile=cachefile, logfile=logfile).cfg cfg = Config(configfile=config, cachefile=cachefile, logfile=logfile).cfg
# Legacy Support # Legacy Support
if cfg.filters.movies.blacklist_title_keywords:
cfg['filters']['movies']['blacklisted_title_keywords'] = cfg['filters']['movies']['blacklist_title_keywords']
if cfg.filters.movies.rating_limit: if cfg.filters.movies.rating_limit:
cfg['filters']['movies']['rotten_tomatoes'] = cfg['filters']['movies']['rating_limit'] cfg['filters']['movies']['rotten_tomatoes'] = cfg['filters']['movies']['rating_limit']

Loading…
Cancel
Save