fix: resolve magic scan crash and implement context-aware AI languages
- Fixed SQL syntax error in magicScan caused by single quotes - Implemented dynamic locale-aware AI suggestions (Technical: EN, Custom Tags: Localized) - Updated Dexie schema to version 2 (added locale to pending_scans) - Fixed missing bottle_id in UploadQueue synchronization - Installed missing dexie dependencies via pnpm
This commit is contained in:
@@ -5,6 +5,7 @@ export interface PendingScan {
|
||||
imageBase64: string;
|
||||
timestamp: number;
|
||||
provider?: 'gemini' | 'nebius';
|
||||
locale?: string;
|
||||
}
|
||||
|
||||
export interface PendingTasting {
|
||||
@@ -45,8 +46,8 @@ export class WhiskyDexie extends Dexie {
|
||||
|
||||
constructor() {
|
||||
super('WhiskyVault');
|
||||
this.version(1).stores({
|
||||
pending_scans: '++id, timestamp',
|
||||
this.version(2).stores({
|
||||
pending_scans: '++id, timestamp, locale',
|
||||
pending_tastings: '++id, bottle_id, tasted_at',
|
||||
cache_tags: 'id, category, name',
|
||||
cache_buddies: 'id, name'
|
||||
|
||||
@@ -19,6 +19,8 @@ Extract precise metadata. If the image is NOT a whisky bottle or if you are very
|
||||
If a value is not visible, use null.
|
||||
Infer the 'Category' (e.g., Islay Single Malt) based on the Distillery if possible.
|
||||
Search specifically for a "Whiskybase ID" or "WB ID" on the label.
|
||||
IMPORTANT: Extract technical metadata (name, distillery, category) in English.
|
||||
The 'suggested_custom_tags' MUST be localized in {LANGUAGE}.
|
||||
|
||||
PART 2: SENSORY ANALYSIS (AUTO-FILL)
|
||||
Based on the identified bottle, select the most appropriate flavor tags.
|
||||
|
||||
Reference in New Issue
Block a user