feat: duplicate detection + original URL in description

- Add original recipe URL to Mealie description (appended after blank line)
- Check for duplicate recipes on scrape (match orgURL or URL in description)
- Show warning with link to existing recipe if duplicate found
- User can still import anyway (warning only, not blocking)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 09:02:53 +01:00
parent a27b322409
commit f7810ba33d
4 changed files with 63 additions and 4 deletions
+1
View File
@@ -162,6 +162,7 @@
.text-dim { color: var(--text-dim); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.flex { display: flex; gap: 0.75rem; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; }
+8 -1
View File
@@ -232,7 +232,14 @@ async function scrapeRecipe() {
currentRecipe = data.data;
populatePreview(currentRecipe);
document.getElementById('previewCard').classList.add('visible');
status.innerHTML = '<span class="text-success">✓ Beolvasva</span>';
if (data.duplicate) {
status.innerHTML = '<span class="text-warning">⚠ Ez a recept már létezik Mealie-ben: '
+ '<a href="' + escHtml(data.duplicate.url) + '" target="_blank" style="color:var(--accent)">'
+ escHtml(data.duplicate.name) + '</a></span>';
} else {
status.innerHTML = '<span class="text-success">✓ Beolvasva</span>';
}
} catch (e) {
status.innerHTML = '<span class="text-danger">Hálózati hiba: ' + e.message + '</span>';
}