feat: persist COCO and YOLO imports for resume
This commit is contained in:
parent
238ff296c3
commit
e18c1a6e33
4 changed files with 21 additions and 2 deletions
|
|
@ -2,6 +2,7 @@ import { api } from './api'
|
|||
import { deleteUpload, prepareUploadStorage, saveUpload, type StoredUpload } from './uploadStore'
|
||||
import { API_BASE_URL, STORAGE_KEYS } from '@/app/constants'
|
||||
import { getStorageItem } from '@/utils/storage'
|
||||
import { importCocoFile, importYoloFiles } from './datasetImportService'
|
||||
|
||||
export type UploadTaskStatus = 'pending' | 'uploading' | 'done' | 'error' | 'skipped'
|
||||
|
||||
|
|
@ -455,3 +456,9 @@ export async function resumeStoredZip(stored: StoredUpload, onProgress?: (messag
|
|||
onProgress?.(`Đang import ZIP ${done}/${total} ảnh…`))
|
||||
await deleteUpload(stored.id)
|
||||
}
|
||||
|
||||
export async function resumeStoredAnnotationImport(stored: StoredUpload) {
|
||||
if (stored.kind === 'coco') await importCocoFile(stored.projectId, stored.files[0]!)
|
||||
else await importYoloFiles(stored.projectId, stored.files)
|
||||
await deleteUpload(stored.id)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue