This commit is contained in:
+9
-3
@@ -1259,16 +1259,22 @@ async def populate_database(background_tasks: BackgroundTasks, media_type: str =
|
|||||||
Status message indicating population has started
|
Status message indicating population has started
|
||||||
"""
|
"""
|
||||||
from core.database_populator import DatabasePopulator
|
from core.database_populator import DatabasePopulator
|
||||||
|
import os
|
||||||
|
|
||||||
db = dependencies["db"]
|
db = dependencies["db"]
|
||||||
config = dependencies["config"]
|
|
||||||
|
|
||||||
# Get Radarr and Sonarr clients
|
# Get Radarr and Sonarr clients
|
||||||
from clients.radarr_client import RadarrClient
|
from clients.radarr_client import RadarrClient
|
||||||
from clients.sonarr_client import SonarrClient
|
from clients.sonarr_client import SonarrClient
|
||||||
|
|
||||||
radarr_client = RadarrClient(config)
|
radarr_client = RadarrClient(
|
||||||
sonarr_client = SonarrClient(config)
|
os.environ.get("RADARR_URL", ""),
|
||||||
|
os.environ.get("RADARR_API_KEY", "")
|
||||||
|
)
|
||||||
|
sonarr_client = SonarrClient(
|
||||||
|
os.environ.get("SONARR_URL", ""),
|
||||||
|
os.environ.get("SONARR_API_KEY", "")
|
||||||
|
)
|
||||||
|
|
||||||
if media_type not in ["both", "movies", "tv"]:
|
if media_type not in ["both", "movies", "tv"]:
|
||||||
raise HTTPException(status_code=400, detail="media_type must be 'both', 'movies', or 'tv'")
|
raise HTTPException(status_code=400, detail="media_type must be 'both', 'movies', or 'tv'")
|
||||||
|
|||||||
Reference in New Issue
Block a user