Use trakt_cache path from config
MODIFY
plex_trakt_sync/commands/cache.py
plex_trakt_sync/commands/cache.py
import click
from requests_cache import CachedSession
-from plex_trakt_sync.path import trakt_cache
+from plex_trakt_sync.factory import factory
def get_sorted_cache(session: CachedSession, sorting: str, reverse: bool):
@@ -83,6 +83,9 @@ def cache(sort: str, limit: int, reverse: bool, url: str):
"""
Manage and analyze Requests Cache.
"""
+
+ config = factory.config()
+ trakt_cache = config["cache"]["path"]
session = CachedSession(cache_name=trakt_cache, backend='sqlite')
if url:

MODIFY
plex_trakt_sync/decorators/http_cache.py
plex_trakt_sync/decorators/http_cache.py
from functools import wraps
from plex_trakt_sync.factory import factory
-from plex_trakt_sync.path import trakt_cache
cache = factory.requests_cache()
session = factory.session()
+config = factory.config()
+trakt_cache = config["cache"]["path"]
def http_cache(method, expire_after=None):

MODIFY
plex_trakt_sync/factory.py
plex_trakt_sync/factory.py
@@ -38,8 +38,9 @@ def plex_server(self):
@memoize
def session(self):
from requests_cache import CachedSession
- from plex_trakt_sync.path import trakt_cache
+ config = self.config()
+ trakt_cache = config["cache"]["path"]
session = CachedSession(trakt_cache)
return session
@@ -47,7 +48,9 @@ def session(self):
@memoize
def requests_cache(self):
import requests_cache
- from plex_trakt_sync.path import trakt_cache
+
+ config = self.config()
+ trakt_cache = config["cache"]["path"]
requests_cache.install_cache(trakt_cache)

Use trakt_cache path from config