Simple frontend added, tests are required

This commit is contained in:
2026-08-01 08:41:25 +00:00
parent b6ace3f68b
commit e87d8089bf
24 changed files with 1473 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
import axios from 'axios'
export const api = axios.create({
baseURL: '/api',
headers: {
'Content-Type': 'application/json',
},
})
export const uploadFile = async (file: File): Promise<{ task_id: string; filename: string; size: number }> => {
const formData = new FormData()
formData.append('file', file)
const response = await api.post('/upload', formData, {
headers: {
'Content-Type': 'multipart/form-data',
},
})
return response.data
}
export const startSplit = async (
task_id: string,
tracklist: TracklistEntry[],
options: SplitOptions
): Promise<{ task_id: string; status: string }> => {
const response = await api.post('/split', {
task_id,
tracklist,
options,
})
return response.data
}
export const getStatus = async (task_id: string): Promise<TaskStatus> => {
const response = await api.get(`/status/${task_id}`)
return response.data
}
export const getDownloadUrl = (task_id: string): string => {
return `/api/download/${task_id}`
}
export const getDownloadZipUrl = (task_id: string): string => {
return `/api/download/${task_id}/splits.zip`
}