A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
feat: Read the archive status from omnivore and pocket. Fixes #703
MohamedBassemc6d21afa1777
diff --git a/apps/web/components/settings/ImportExport.tsx b/apps/web/components/settings/ImportExport.tsxindex e2678bbc..a20bd554 100644--- a/apps/web/components/settings/ImportExport.tsx+++ b/apps/web/components/settings/ImportExport.tsx@@ -137,6 +137,7 @@ export function ImportExportRow() {? new Date(bookmark.addDate * 1000): undefined,note: bookmark.notes,+ archived: bookmark.archived,...(bookmark.content.type === BookmarkTypes.LINK? {type: BookmarkTypes.LINK,diff --git a/apps/web/lib/exportBookmarks.ts b/apps/web/lib/exportBookmarks.tsindex 67b0b5da..5dc26e78 100644--- a/apps/web/lib/exportBookmarks.ts+++ b/apps/web/lib/exportBookmarks.ts@@ -19,6 +19,7 @@ export const zExportBookmarkSchema = z.object({]).nullable(),note: z.string().nullable(),+ archived: z.boolean().optional().default(false),});export const zExportSchema = z.object({@@ -56,6 +57,7 @@ export function toExportFormat(tags: bookmark.tags.map((t) => t.name),content,note: bookmark.note ?? null,+ archived: bookmark.archived,};}diff --git a/apps/web/lib/importBookmarkParser.ts b/apps/web/lib/importBookmarkParser.tsindex a97e4da9..aba11689 100644--- a/apps/web/lib/importBookmarkParser.ts+++ b/apps/web/lib/importBookmarkParser.ts@@ -15,6 +15,7 @@ export interface ParsedBookmark {tags: string[];addDate?: number;notes?: string;+ archived?: boolean;}export async function parseNetscapeBookmarkFile(@@ -64,6 +65,7 @@ export async function parsePocketBookmarkFile(url: string;time_added: string;tags: string;+ status?: string;}[];return records.map((record) => {@@ -72,6 +74,7 @@ export async function parsePocketBookmarkFile(content: { type: BookmarkTypes.LINK as const, url: record.url },tags: record.tags.length > 0 ? record.tags.split("|") : [],addDate: parseInt(record.time_added),+ archived: record.status === "archive",};});}@@ -107,6 +110,7 @@ export async function parseKarakeepBookmarkFile(tags: bookmark.tags,addDate: bookmark.createdAt,notes: bookmark.note ?? undefined,+ archived: bookmark.archived,};});}@@ -121,6 +125,7 @@ export async function parseOmnivoreBookmarkFile(url: z.string(),labels: z.array(z.string()),savedAt: z.coerce.date(),+ state: z.string().optional(),}),);@@ -137,6 +142,7 @@ export async function parseOmnivoreBookmarkFile(content: { type: BookmarkTypes.LINK as const, url: bookmark.url },tags: bookmark.labels,addDate: bookmark.savedAt.getTime() / 1000,+ archived: bookmark.state === "Archived",};});}@@ -242,6 +248,10 @@ export function deduplicateBookmarks(} else if (bookmark.notes) {existing.notes = bookmark.notes;}+ // For archived status, prefer archived if either is archived+ if (bookmark.archived === true) {+ existing.archived = true;+ }// Title: keep existing one for simplicity} else {deduplicatedBookmarksMap.set(url, bookmark);