bug fix 및 player 재생 확인
This commit is contained in:
1 parent
16ef7bd97d
commit
b6ece9891a
10 files changed
+132
-9
No files matched your search
@@ -8,6 +8,7 @@ import {
|
||||
SongGenerateResponse,
|
||||
SongStatusResponse,
|
||||
SongDownloadResponse,
|
||||
SongsListResponse,
|
||||
VideoGenerateResponse,
|
||||
VideoStatusResponse,
|
||||
VideoDownloadResponse,
|
||||
@@ -180,6 +181,19 @@ export async function downloadSong(taskId: string): Promise<SongDownloadResponse
|
||||
return response.json();
|
||||
}
|
||||
|
||||
// 노래 목록 조회 API
|
||||
export async function getSongsList(page: number = 1, pageSize: number = 10): Promise<SongsListResponse> {
|
||||
const response = await fetch(`${API_URL}/songs/?page=${page}&page_size=${pageSize}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
|
||||
return response.json();
|
||||
}
|
||||
|
||||
// 노래 생성 완료까지 폴링 (5분 타임아웃, 3초 간격)
|
||||
// Suno API 상태: PENDING, processing, SUCCESS, TEXT_SUCCESS, failed, error
|
||||
const SONG_POLL_TIMEOUT = 5 * 60 * 1000; // 5분
|
||||
|
||||
Reference in new issue
Block a user