feat: add bulk photo import and image format handling
This commit is contained in:
@@ -42,6 +42,33 @@ const api = {
|
||||
workImage2: string
|
||||
importedAt: string
|
||||
}) => ipcRenderer.invoke('student:update-profile', profile),
|
||||
importStudentPhotos: (payload: { batchId: string; classId: string; zipPath: string }) =>
|
||||
ipcRenderer.invoke('photos:import', payload),
|
||||
pausePhotoImport: (batchId: string) => ipcRenderer.invoke('photos:pause-import', batchId),
|
||||
resumePhotoImport: (batchId: string) => ipcRenderer.invoke('photos:resume-import', batchId),
|
||||
stopPhotoImport: (batchId: string) => ipcRenderer.invoke('photos:stop-import', batchId),
|
||||
onPhotoImportProgress: (
|
||||
callback: (progress: {
|
||||
batchId: string
|
||||
status: 'parsing' | 'started' | 'image-finished' | 'paused' | 'stopped' | 'finished'
|
||||
classId: string
|
||||
className: string
|
||||
studentId?: string
|
||||
studentName?: string
|
||||
current: number
|
||||
total: number
|
||||
matchedImageCount: number
|
||||
skippedImageCount: number
|
||||
}) => void
|
||||
): (() => void) => {
|
||||
const listener = (
|
||||
_: Electron.IpcRendererEvent,
|
||||
progress: Parameters<typeof callback>[0]
|
||||
): void => callback(progress)
|
||||
|
||||
ipcRenderer.on('photos:import-progress', listener)
|
||||
return () => ipcRenderer.removeListener('photos:import-progress', listener)
|
||||
},
|
||||
generateStudentComment: (payload: { profileId: string }) =>
|
||||
ipcRenderer.invoke('student:generate-comment', payload),
|
||||
generateStudentComments: (payload: { classId?: string; profileIds?: string[] }) =>
|
||||
|
||||
Reference in New Issue
Block a user