mirror of
https://github.com/FuzzyGrim/Yamtrack.git
synced 2026-06-27 22:35:55 +00:00
validate hardcover api setting #1352
This commit is contained in:
@@ -15,7 +15,7 @@ This page outlines the environment variables used in the YamTrack project.
|
||||
| `IGDB_ID` | IGDB API key for games. A default key is provided, but it's recommended to get your own as it has a low rate limit. |
|
||||
| `IGDB_SECRET` | IGDB API secret for games. A default value is provided, but it's recommended to get your own as it has a low rate limit. |
|
||||
| `IGDB_NSFW` | Default to `False`. Set to `True` to include adult content in game searches. |
|
||||
| `HARDCOVER_API` | Hardcover API key for books. A default key is provided, but it's recommended to get your own as it has a low rate limit. |
|
||||
| `HARDCOVER_API` | Hardcover API key for books. A default key is provided, but it's recommended to get your own as it has a low rate limit. Custom values must include the `Bearer ` prefix. |
|
||||
| `COMICVINE_API` | ComicVine API key for comics. A default key is provided, but it's recommended to get your own as it has a low rate limit. |
|
||||
|
||||
## Media Import
|
||||
|
||||
@@ -18,6 +18,7 @@ from decouple import (
|
||||
undefined,
|
||||
)
|
||||
from django.core.cache import CacheKeyWarning
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
|
||||
BASE_URL = config("BASE_URL", default=None)
|
||||
if BASE_URL:
|
||||
@@ -424,6 +425,10 @@ HARDCOVER_API = config(
|
||||
"j4MVAEi_-w2N7DuiMgAxkfVc6RuKd88AHrOyzF5xLyU",
|
||||
),
|
||||
)
|
||||
HARDCOVER_API = HARDCOVER_API.strip()
|
||||
if not HARDCOVER_API.startswith("Bearer "):
|
||||
msg = "HARDCOVER_API must start with 'Bearer '."
|
||||
raise ImproperlyConfigured(msg)
|
||||
|
||||
COMICVINE_API = config(
|
||||
"COMICVINE_API",
|
||||
|
||||
Reference in New Issue
Block a user