mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 13:53:15 -07:00
Updates vendored subliminal to 2.1.0
Updates rarfile to 3.1 Updates stevedore to 3.5.0 Updates appdirs to 1.4.4 Updates click to 8.1.3 Updates decorator to 5.1.1 Updates dogpile.cache to 1.1.8 Updates pbr to 5.11.0 Updates pysrt to 1.1.2 Updates pytz to 2022.6 Adds importlib-metadata version 3.1.1 Adds typing-extensions version 4.1.1 Adds zipp version 3.11.0
This commit is contained in:
parent
d8da02cb69
commit
f05b09f349
694 changed files with 16621 additions and 11056 deletions
|
@ -1,7 +1,9 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import datetime
|
||||
|
||||
import six
|
||||
from dogpile.cache import make_region
|
||||
from dogpile.cache.util import function_key_generator
|
||||
|
||||
#: Expiration time for show caching
|
||||
SHOW_EXPIRATION_TIME = datetime.timedelta(weeks=3).total_seconds()
|
||||
|
@ -13,4 +15,23 @@ EPISODE_EXPIRATION_TIME = datetime.timedelta(days=3).total_seconds()
|
|||
REFINER_EXPIRATION_TIME = datetime.timedelta(weeks=1).total_seconds()
|
||||
|
||||
|
||||
region = make_region()
|
||||
def _to_native_str(value):
|
||||
if six.PY2:
|
||||
# In Python 2, the native string type is bytes
|
||||
if isinstance(value, six.text_type): # unicode for Python 2
|
||||
return value.encode('utf-8')
|
||||
else:
|
||||
return six.binary_type(value)
|
||||
else:
|
||||
# In Python 3, the native string type is unicode
|
||||
if isinstance(value, six.binary_type): # bytes for Python 3
|
||||
return value.decode('utf-8')
|
||||
else:
|
||||
return six.text_type(value)
|
||||
|
||||
|
||||
def to_native_str_key_generator(namespace, fn, to_str=_to_native_str):
|
||||
return function_key_generator(namespace, fn, to_str)
|
||||
|
||||
|
||||
region = make_region(function_key_generator=to_native_str_key_generator)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue