logs
Browse files
src/lib/components/AutoTrainerScanner/AutoTrainerScanner.svelte
CHANGED
|
@@ -159,8 +159,20 @@
|
|
| 159 |
|
| 160 |
async function onTrainerImageCompleted(imagePath: string, picletId: number) {
|
| 161 |
console.log(`β
Trainer image completed: ${imagePath} -> Piclet ID: ${picletId}`);
|
| 162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
await updateProgress();
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
}
|
| 165 |
|
| 166 |
async function onTrainerImageFailed(imagePath: string, error: string) {
|
|
|
|
| 159 |
|
| 160 |
async function onTrainerImageCompleted(imagePath: string, picletId: number) {
|
| 161 |
console.log(`β
Trainer image completed: ${imagePath} -> Piclet ID: ${picletId}`);
|
| 162 |
+
console.log(`π§ DEBUG: Marking ${imagePath} as completed in database...`);
|
| 163 |
+
|
| 164 |
+
try {
|
| 165 |
+
await markImageProcessingCompleted(imagePath, picletId);
|
| 166 |
+
console.log(`β
DEBUG: Successfully marked ${imagePath} as completed`);
|
| 167 |
+
} catch (error) {
|
| 168 |
+
console.error(`β DEBUG: Failed to mark ${imagePath} as completed:`, error);
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
await updateProgress();
|
| 172 |
+
|
| 173 |
+
// Check what getNextPendingImage returns after this update
|
| 174 |
+
const nextImage = await getNextPendingImage();
|
| 175 |
+
console.log(`π§ DEBUG: Next pending image after completion:`, nextImage?.imagePath || 'null');
|
| 176 |
}
|
| 177 |
|
| 178 |
async function onTrainerImageFailed(imagePath: string, error: string) {
|
src/lib/db/trainerScanning.ts
CHANGED
|
@@ -116,11 +116,19 @@ export async function markImageProcessingCompleted(
|
|
| 116 |
imagePath: string,
|
| 117 |
picletInstanceId: number
|
| 118 |
): Promise<void> {
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
}
|
| 125 |
|
| 126 |
// Mark image processing as failed
|
|
|
|
| 116 |
imagePath: string,
|
| 117 |
picletInstanceId: number
|
| 118 |
): Promise<void> {
|
| 119 |
+
console.log(`π§ DB DEBUG: markImageProcessingCompleted called for: ${imagePath}`);
|
| 120 |
+
|
| 121 |
+
try {
|
| 122 |
+
await updateScanProgress(imagePath, {
|
| 123 |
+
status: 'completed',
|
| 124 |
+
picletInstanceId,
|
| 125 |
+
completedAt: new Date()
|
| 126 |
+
});
|
| 127 |
+
console.log(`β
DB DEBUG: Successfully updated ${imagePath} to completed status`);
|
| 128 |
+
} catch (error) {
|
| 129 |
+
console.error(`β DB DEBUG: Failed to update ${imagePath}:`, error);
|
| 130 |
+
throw error;
|
| 131 |
+
}
|
| 132 |
}
|
| 133 |
|
| 134 |
// Mark image processing as failed
|