aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMichiel van Baak <[email protected]>2021-03-14 11:34:12 +0100
committerMichiel van Baak <[email protected]>2021-03-14 11:34:12 +0100
commitf10bac1fad0c3a147483e151b4115b3d45fe1442 (patch)
tree451db2b578e1328fd5cb3fb48d15363e4d53ae0e
parent9a84cc8da3ab1096d2ab3bf903a28a321ce8478c (diff)
downloadbazarr-f10bac1fad0c3a147483e151b4115b3d45fe1442.tar.gz
bazarr-f10bac1fad0c3a147483e151b4115b3d45fe1442.zip
Revert "Make subliminal always mangle cache keys to prevent long filenames"
This reverts commit 87fbd196a404dbc7c6e12caf39b309c692f8e7e8.
-rw-r--r--bazarr/init.py7
-rw-r--r--libs/subliminal/cache.py5
2 files changed, 8 insertions, 4 deletions
diff --git a/bazarr/init.py b/bazarr/init.py
index cb107d890..bfe2d07f9 100644
--- a/bazarr/init.py
+++ b/bazarr/init.py
@@ -11,7 +11,9 @@ from get_args import args
from logger import configure_logging
from helper import path_mappings
+from dogpile.cache import make_region
from dogpile.cache.region import register_backend as register_cache_backend
+from dogpile.cache.util import sha1_mangle_key
import subliminal
import datetime
@@ -114,7 +116,10 @@ db_upgrade()
# Configure dogpile file caching for Subliminal request
register_cache_backend("subzero.cache.file", "subzero.cache_backends.file", "SZFileBackend")
-subliminal.region.configure(
+
+subliminal.region = make_region(
+ key_mangler=sha1_mangle_key
+).configure(
'subzero.cache.file',
expiration_time=datetime.timedelta(days=30),
arguments={'appname': "sz_cache", 'app_cache_dir': args.config_dir}
diff --git a/libs/subliminal/cache.py b/libs/subliminal/cache.py
index 40344c4e4..3d8848e1d 100644
--- a/libs/subliminal/cache.py
+++ b/libs/subliminal/cache.py
@@ -3,7 +3,6 @@ from __future__ import absolute_import
import datetime
from dogpile.cache import make_region
-from dogpile.cache.util import sha1_mangle_key
#: Expiration time for show caching
SHOW_EXPIRATION_TIME = datetime.timedelta(weeks=3).total_seconds()
@@ -14,5 +13,5 @@ EPISODE_EXPIRATION_TIME = datetime.timedelta(days=3).total_seconds()
#: Expiration time for scraper searches
REFINER_EXPIRATION_TIME = datetime.timedelta(weeks=1).total_seconds()
-# Mangle keys to prevent long filenames
-region = make_region(key_mangler=sha1_mangle_key)
+
+region = make_region()