diff --git a/src/program/apis/trakt_api.py b/src/program/apis/trakt_api.py index 31ffafe3..b93ba19e 100644 --- a/src/program/apis/trakt_api.py +++ b/src/program/apis/trakt_api.py @@ -1,4 +1,5 @@ -import re +import os +import re from datetime import datetime from types import SimpleNamespace from typing import List, Optional, Union @@ -50,7 +51,8 @@ def __init__(self, settings: TraktModel): self.oauth_redirect_uri = self.settings.oauth.oauth_redirect_uri rate_limit_params = get_rate_limit_params(max_calls=1000, period=300) trakt_cache = get_cache_params("trakt", 86400) - session = create_service_session(rate_limit_params=rate_limit_params, use_cache=True, cache_params=trakt_cache) + use_cache = not os.environ.get("SKIP_TRAKT_CACHE", False) + session = create_service_session(rate_limit_params=rate_limit_params, use_cache=use_cache, cache_params=trakt_cache) self.headers = { "Content-type": "application/json", "trakt-api-key": self.CLIENT_ID,