forked from kenzuya/unshackle
refactor(tags): remove environment variable fallbacks for API keys
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
@@ -44,11 +43,11 @@ def _get_session() -> requests.Session:
|
|||||||
|
|
||||||
|
|
||||||
def _api_key() -> Optional[str]:
|
def _api_key() -> Optional[str]:
|
||||||
return config.tmdb_api_key or os.getenv("TMDB_API_KEY")
|
return config.tmdb_api_key
|
||||||
|
|
||||||
|
|
||||||
def _simkl_client_id() -> Optional[str]:
|
def _simkl_client_id() -> Optional[str]:
|
||||||
return config.simkl_client_id or os.getenv("SIMKL_CLIENT_ID")
|
return config.simkl_client_id
|
||||||
|
|
||||||
|
|
||||||
def _clean(s: str) -> str:
|
def _clean(s: str) -> str:
|
||||||
@@ -474,9 +473,7 @@ def external_ids(
|
|||||||
try:
|
try:
|
||||||
detail_response = _fetch_tmdb_detail(tmdb_id, kind)
|
detail_response = _fetch_tmdb_detail(tmdb_id, kind)
|
||||||
if detail_response:
|
if detail_response:
|
||||||
title_cacher.cache_tmdb(
|
title_cacher.cache_tmdb(cache_title_id, detail_response, js, kind, cache_region, cache_account_hash)
|
||||||
cache_title_id, detail_response, js, kind, cache_region, cache_account_hash
|
|
||||||
)
|
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
log.debug("Failed to cache TMDB data: %s", exc)
|
log.debug("Failed to cache TMDB data: %s", exc)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user