Get requests_cache from factory
MODIFY
plex_trakt_sync/decorators/http_cache.py
plex_trakt_sync/decorators/http_cache.py
from functools import wraps
-import requests_cache
-
+from plex_trakt_sync.factory import factory
from plex_trakt_sync.path import trakt_cache
+cache = factory.requests_cache()
+
def http_cache(method, expire_after=None):
@wraps(method)
def inner(self, *args, **kwargs):
- with requests_cache.enabled(trakt_cache, expire_after=expire_after):
+ with cache.enabled(trakt_cache, expire_after=expire_after):
return method(self, *args, **kwargs)
return inner

MODIFY
plex_trakt_sync/decorators/nocache.py
plex_trakt_sync/decorators/nocache.py
from functools import wraps
-import requests_cache
+from plex_trakt_sync.factory import factory
+
+cache = factory.requests_cache()
def nocache(method):
@wraps(method)
def inner(self, *args, **kwargs):
- with requests_cache.disabled():
+ with cache.disabled():
return method(self, *args, **kwargs)
return inner

Get requests_cache from factory