mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-24 21:38:09 +02:00
feat(podcast): GET /podcasts/languages
This commit is contained in:
parent
fe4d69f478
commit
1ee38fc9ab
1 changed files with 15 additions and 0 deletions
|
|
@ -45,6 +45,7 @@ from app.utils.rbac import check_permission
|
||||||
|
|
||||||
from .schemas import (
|
from .schemas import (
|
||||||
CreatePodcastRequest,
|
CreatePodcastRequest,
|
||||||
|
LanguageOptions,
|
||||||
PodcastDetail,
|
PodcastDetail,
|
||||||
PodcastSummary,
|
PodcastSummary,
|
||||||
UpdateSpecRequest,
|
UpdateSpecRequest,
|
||||||
|
|
@ -112,6 +113,20 @@ async def list_voices(language: str | None = None):
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/podcasts/languages", response_model=LanguageOptions)
|
||||||
|
async def list_languages():
|
||||||
|
"""Languages the active TTS provider can offer the brief editor."""
|
||||||
|
if not app_config.TTS_SERVICE:
|
||||||
|
raise HTTPException(status_code=503, detail="No TTS provider configured")
|
||||||
|
|
||||||
|
provider = provider_from_service(app_config.TTS_SERVICE)
|
||||||
|
offering = get_voice_catalog().offerable_languages(provider)
|
||||||
|
return LanguageOptions(
|
||||||
|
languages=offering.languages,
|
||||||
|
allows_custom=offering.allows_custom,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@router.get("/podcasts/voices/{voice_id}/preview")
|
@router.get("/podcasts/voices/{voice_id}/preview")
|
||||||
async def preview_voice(
|
async def preview_voice(
|
||||||
voice_id: str,
|
voice_id: str,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue