feat(audiobook): add endpoint to retrieve audio for a specific segment

This commit is contained in:
2026-03-09 11:48:47 +08:00
parent a3d7d318e0
commit 9b6691bffe
3 changed files with 143 additions and 30 deletions

View File

@@ -101,9 +101,12 @@ export const audiobookApi = {
},
getDownloadUrl: (id: number, chapter?: number): string => {
const base = import.meta.env.VITE_API_URL || ''
const chapterParam = chapter !== undefined ? `?chapter=${chapter}` : ''
return `${base}/audiobook/projects/${id}/download${chapterParam}`
return `/audiobook/projects/${id}/download${chapterParam}`
},
getSegmentAudioUrl: (projectId: number, segmentId: number): string => {
return `/audiobook/projects/${projectId}/segments/${segmentId}/audio`
},
deleteProject: async (id: number): Promise<void> => {