mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
fix(tts): key the audio cache by provider and add a settings clear action
- Hash text, voice, model, speed, normalized endpoint and API key into one SHA-256 key shared by the disk cache and in-flight synthesis, so different providers cannot reuse each other's audio and old keys are not read as fallback. - Add DELETE /api/tts/cache to remove completed cached audio files, keep temporary files, tolerate missing files and report real failures. - Add a Clear audio cache action to TTS settings, available even when TTS is disabled or the builtin provider is selected, with pending, success and retryable error states.
This commit is contained in:
1 parent
1eba33c6f1
commit
169ee25a8a
5 files changed
+511
-35
No files matched your search
@@ -11,6 +11,10 @@ export interface TTSVoicesResponse {
|
||||
cached: boolean
|
||||
}
|
||||
|
||||
export interface TTSClearCacheResponse {
|
||||
cleared: number
|
||||
}
|
||||
|
||||
export interface TTSStatusResponse {
|
||||
enabled: boolean
|
||||
configured: boolean
|
||||
@@ -42,6 +46,12 @@ export const ttsApi = {
|
||||
})
|
||||
},
|
||||
|
||||
clearCache: async (): Promise<TTSClearCacheResponse> => {
|
||||
return fetchWrapper(`${API_BASE_URL}/api/tts/cache`, {
|
||||
method: 'DELETE',
|
||||
})
|
||||
},
|
||||
|
||||
synthesize: async (text: string, userId = 'default', signal?: AbortSignal): Promise<Blob> => {
|
||||
return fetchWrapperBlob(`${API_BASE_URL}/api/tts/synthesize`, {
|
||||
method: 'POST',
|
||||
|
||||
Reference in new issue
Block a user