summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2021-03-14 07:44:42 -0400
committerGitHub <[email protected]>2021-03-14 07:44:42 -0400
commit176f4c21f4d127bc8cdf749fd1c51bb55cab6287 (patch)
treeb19ac853a021b2e4701b7084d78b1da1c28da006
parent9a84cc8da3ab1096d2ab3bf903a28a321ce8478c (diff)
parent75d49e2f3366871bd694fe981ae271f8f1a19600 (diff)
downloadbazarr-176f4c21f4d127bc8cdf749fd1c51bb55cab6287.tar.gz
bazarr-176f4c21f4d127bc8cdf749fd1c51bb55cab6287.zip
Merge pull request #1317 from mvanbaak/revert-cache-changes
Revert cache changes
-rw-r--r--bazarr/init.py14
-rw-r--r--libs/subliminal/cache.py5
2 files changed, 7 insertions, 12 deletions
diff --git a/bazarr/init.py b/bazarr/init.py
index cb107d890..4ef90ffdb 100644
--- a/bazarr/init.py
+++ b/bazarr/init.py
@@ -109,16 +109,12 @@ if not os.path.exists(os.path.join(args.config_dir, 'db', 'bazarr.db')):
# upgrade database schema
from database import db_upgrade
-
db_upgrade()
# Configure dogpile file caching for Subliminal request
register_cache_backend("subzero.cache.file", "subzero.cache_backends.file", "SZFileBackend")
-subliminal.region.configure(
- 'subzero.cache.file',
- expiration_time=datetime.timedelta(days=30),
- arguments={'appname': "sz_cache", 'app_cache_dir': args.config_dir}
-)
+subliminal.region.configure('subzero.cache.file', expiration_time=datetime.timedelta(days=30),
+ arguments={'appname': "sz_cache", 'app_cache_dir': args.config_dir})
subliminal.region.backend.sync()
if not os.path.exists(os.path.join(args.config_dir, 'config', 'releases.txt')):
@@ -181,20 +177,20 @@ with open(os.path.normpath(os.path.join(args.config_dir, 'config', 'config.ini')
def init_binaries():
from utils import get_binary
exe = get_binary("unrar")
-
+
rarfile.UNRAR_TOOL = exe
rarfile.ORIG_UNRAR_TOOL = exe
try:
rarfile.custom_check([rarfile.UNRAR_TOOL], True)
except:
logging.debug("custom check failed for: %s", exe)
-
+
rarfile.OPEN_ARGS = rarfile.ORIG_OPEN_ARGS
rarfile.EXTRACT_ARGS = rarfile.ORIG_EXTRACT_ARGS
rarfile.TEST_ARGS = rarfile.ORIG_TEST_ARGS
logging.debug("Using UnRAR from: %s", exe)
unrar = exe
-
+
return unrar
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()