diff options
author | LASER-Yi <[email protected]> | 2021-06-10 20:28:34 +0800 |
---|---|---|
committer | LASER-Yi <[email protected]> | 2021-06-10 20:28:34 +0800 |
commit | b881a821550d1773546aa7e401aba271048f4d81 (patch) | |
tree | 8d017d726fc77287977dbd9cb9559392da8235ba | |
parent | 29fffd4e810c38c990663fb6cc3c55b0a7c0cb12 (diff) | |
download | bazarr-b881a821550d1773546aa7e401aba271048f4d81.tar.gz bazarr-b881a821550d1773546aa7e401aba271048f4d81.zip |
Fix incorrect providers and remove unnecessary codes in history stats
-rw-r--r-- | bazarr/api.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/bazarr/api.py b/bazarr/api.py index 9814c4c54..b3024d29b 100644 --- a/bazarr/api.py +++ b/bazarr/api.py @@ -359,11 +359,7 @@ class Languages(Resource): languages += list(TableHistoryMovie.select(TableHistoryMovie.language) .where(TableHistoryMovie.language != None) .dicts()) - languages_set = set() - for l in languages: - if l not in None_Keys and l['language'] not in None_Keys: - languages_set.add(l['language'].split(':')[0]) - languages_list = list(languages_set) + languages_list = list(set([l['language'].split(':')[0] for l in languages])) languages_dicts = [] for language in languages_list: code2 = None @@ -1142,15 +1138,15 @@ class Providers(Resource): history = request.args.get('history') if history and history not in False_Keys: providers = list(TableHistory.select(TableHistory.provider) - .where(TableHistory.provider != None) + .where(TableHistory.provider != None and TableHistory.provider != "manual") .dicts()) providers += list(TableHistoryMovie.select(TableHistoryMovie.provider) - .where(TableHistoryMovie.provider != None) + .where(TableHistoryMovie.provider != None and TableHistoryMovie.provider != "manual") .dicts()) providers_list = list(set([x['provider'] for x in providers])) providers_dicts = [] for provider in providers_list: - providers_dicts.append({ + providers_dicts.append({ 'name': provider, 'status': 'History', 'retry': '-' |