Fiters: Blank languages list will not fallback to english anymore

pull/132/head
desimaniac 5 years ago
parent b576aff595
commit 548fe7d17b

@ -603,7 +603,7 @@ Use filters to specify the movie/shows's country of origin or blacklist (i.e. fi
- Blank list (i.e. `[]`) - Add movies from any country.
- `ignore` (i.e. `["ignore"]`) Add movies from any country, including ones with no country specified.
- `ignore` (i.e. `["ignore"]`) - Add movies from any country, including ones with no country specified.
`allowed_languages` - Only add movies with these languages. Listed as two-letter language codes.
@ -613,7 +613,9 @@ Use filters to specify the movie/shows's country of origin or blacklist (i.e. fi
- Special keywords:
- Blank list (i.e. `[]`) - Only add shows that are in English (`en`).
- Blank list (i.e. `[]`) - Add movies with any language.
- `ignore` (i.e. `["ignore"]`) - Add movies with any language, including ones with no language specified.
`blacklisted_genres` - Blacklist certain genres.
@ -729,7 +731,7 @@ Use filters to specify the movie/shows's country of origin or blacklist (i.e. fi
- Blank list (i.e. `[]`) - Add shows from any country.
- `ignore` (i.e. `["ignore"]`) Add shows from any country, including ones with no country specified.
- `ignore` (i.e. `["ignore"]`) - Add shows from any country, including ones with no country specified.
`allowed_languages` - Only add shows with these languages.
@ -739,7 +741,9 @@ Use filters to specify the movie/shows's country of origin or blacklist (i.e. fi
- Special keywords:
- Blank list (i.e. `[]`) - Only add shows that are in English (`en`).
- Blank list (i.e. `[]`) - Add shows with any language.
- `ignore` (i.e. `["ignore"]`) - Add shows with any language, including ones with no language specified.
`blacklisted_genres` - Blacklist certain genres.

@ -122,9 +122,6 @@ def blacklisted_show_country(show, allowed_countries):
def blacklisted_show_language(show, allowed_languages):
blacklisted = False
# [] - add show items with 'en' language
if not allowed_languages:
allowed_languages = ['en']
try:
# ["ignore"] - add show item even if it is missing a language
if any('ignore' in s.lower() for s in allowed_languages):
@ -134,6 +131,10 @@ def blacklisted_show_language(show, allowed_languages):
log.debug("\'%s\' | Blacklisted Languages Check | Blacklisted because it had no language specified.",
show['show']['title'])
blacklisted = True
# [] - add show item from any valid language
elif not allowed_languages:
log.debug("\'%s\' | Blacklisted Languages Check | Skipped.",
show['show']['title'])
# List provided - skip adding show item if the language is blacklisted
elif not any(show['show']['language'].lower() in c.lower() for c in allowed_languages):
log.debug("\'%s\' | Blacklisted Languages Check | Blacklisted because it's in the language: %s",
@ -308,9 +309,6 @@ def blacklisted_movie_country(movie, allowed_countries):
def blacklisted_movie_language(movie, allowed_languages):
blacklisted = False
# [] - add movie items with 'en' language
if not allowed_languages:
allowed_languages = ['en']
try:
# ["ignore"] - add movie item even if it is missing a language
if any('ignore' in s.lower() for s in allowed_languages):
@ -321,6 +319,10 @@ def blacklisted_movie_language(movie, allowed_languages):
log.debug("\'%s\' | Blacklisted Languages Check | Blacklisted because it had no language specified.",
movie['movie']['title'])
blacklisted = True
# [] - add movie item from any valid language
elif not allowed_languages:
log.debug("\'%s\' | Blacklisted Languages Check | Skipped.",
movie['movie']['title'])
# List provided - skip adding movie item if the language is blacklisted
elif not any(movie['movie']['language'].lower() in s.lower() for s in allowed_languages):
log.debug("\'%s\' | Blacklisted Languages Check | Blacklisted because it's in the language: %s",

@ -100,18 +100,16 @@ class Trakt:
if payload is None:
payload = {}
# languages list
if not languages:
languages = ['en']
languages = ','.join(languages).lower()
payload = dict_merge(payload, {
'extended': 'full',
'limit': limit,
'page': 1,
'languages': languages,
})
# languages list
if languages:
payload['languages'] = ','.join(languages).lower()
# years range
if years:
payload['years'] = years

Loading…
Cancel
Save