1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-25 09:12:38 +00:00

Handle invalid content in the throttled_providers data file

This commit is contained in:
morpheus65535 2021-03-15 08:21:23 -04:00 committed by GitHub
commit 337578f79e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -298,4 +298,12 @@ def set_throttled_providers(data):
handle.write(data)
tp = eval(str(get_throttled_providers()))
try:
tp = eval(str(get_throttled_providers()))
if not isinstance(tp, dict):
raise ValueError('tp should be a dict')
except Exception:
logging.error("Invalid content in throttled_providers.dat. Resetting")
# set empty content in throttled_providers.dat
set_throttled_providers('')
tp = eval(str(get_throttled_providers()))