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
|
||||
"""
|
||||
from core.database_populator import DatabasePopulator
|
||||
import os
|
||||
|
||||
db = dependencies["db"]
|
||||
config = dependencies["config"]
|
||||
|
||||
# Get Radarr and Sonarr clients
|
||||
from clients.radarr_client import RadarrClient
|
||||
from clients.sonarr_client import SonarrClient
|
||||
|
||||
radarr_client = RadarrClient(config)
|
||||
sonarr_client = SonarrClient(config)
|
||||
radarr_client = RadarrClient(
|
||||
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"]:
|
||||
raise HTTPException(status_code=400, detail="media_type must be 'both', 'movies', or 'tv'")
|
||||
|
||||
Reference in New Issue
Block a user