| .. | .. |
|---|
| 114 | 114 | }; |
|---|
| 115 | 115 | } |
|---|
| 116 | 116 | |
|---|
| 117 | | - /// Lightweight JSON for persistence (strips heavy binary fields). |
|---|
| 117 | + /// Lightweight JSON for persistence (strips temp audio paths, keeps images). |
|---|
| 118 | 118 | Map<String, dynamic> toJsonLight() { |
|---|
| 119 | 119 | return { |
|---|
| 120 | 120 | 'id': id, |
|---|
| .. | .. |
|---|
| 124 | 124 | 'timestamp': timestamp, |
|---|
| 125 | 125 | if (status != null) 'status': status!.name, |
|---|
| 126 | 126 | if (duration != null) 'duration': duration, |
|---|
| 127 | + // Keep imageBase64 — images are typically 50-200 KB and must survive restart. |
|---|
| 128 | + // audioUri is intentionally omitted: it is a temp file path that won't survive restart. |
|---|
| 129 | + if (imageBase64 != null) 'imageBase64': imageBase64, |
|---|
| 127 | 130 | }; |
|---|
| 128 | 131 | } |
|---|
| 129 | 132 | |
|---|