35 lines
702 B
Python
35 lines
702 B
Python
"""
|
|
Kronic resolver wrapper with SpotDL routes.
|
|
|
|
This intentionally imports the existing resolver app unchanged, then mounts
|
|
the SpotDL router on that same FastAPI application.
|
|
|
|
Run with:
|
|
python -m uvicorn kronic.resolver.app_spotdl:app --host 127.0.0.1 --port 3030
|
|
"""
|
|
|
|
from .app import app
|
|
from .spotdl_router import router as spotdl_router
|
|
|
|
|
|
def _has_spotdl_route() -> bool:
|
|
for route in getattr(
|
|
app,
|
|
"routes",
|
|
[],
|
|
):
|
|
if getattr(
|
|
route,
|
|
"path",
|
|
None,
|
|
) == "/api/music/spotify/resolve":
|
|
return True
|
|
|
|
return False
|
|
|
|
|
|
if not _has_spotdl_route():
|
|
app.include_router(
|
|
spotdl_router
|
|
)
|