From 103ce6f207558c6dcb6cdac5c5eba79b98d70edd Mon Sep 17 00:00:00 2001 From: ergosteur <1992147+ergosteur@users.noreply.github.com> Date: Sat, 7 Mar 2026 05:05:08 -0500 Subject: [PATCH] fix: exhaustive generic parser and implement local archive history --- GEMINI.md | 3 + server.ts | 9 +- src/App.tsx | 448 +++++++++++++++++++++++++++++----------------------- 3 files changed, 262 insertions(+), 198 deletions(-) diff --git a/GEMINI.md b/GEMINI.md index 0b97fc8..305fa9d 100644 --- a/GEMINI.md +++ b/GEMINI.md @@ -21,6 +21,9 @@ - **Backend:** Express, tsx (for server-side scanning) - **Decompression:** xz-decompress (WASM) +## Known Issues +- **Generic Collection Parser:** Currently unreliable for non-Instagram archive structures (e.g., folders with arbitrary media filenames). It may fail to correctly identify or group posts in some environments. + ## Commands - `npm install`: Install project dependencies. - `npm run dev`: Start the local development server on port 3000. diff --git a/server.ts b/server.ts index 12181d4..f6eba46 100644 --- a/server.ts +++ b/server.ts @@ -43,8 +43,13 @@ app.get('/api/archives', (req, res) => { const archives = items .filter(item => { const isDir = item.isDirectory(); - if (!isDir) console.log(`[API] Skipping non-directory: ${item.name}`); - return isDir; + const isHidden = item.name.startsWith('.') || item.name.startsWith('@') || item.name.startsWith('_'); + if (!isDir) return false; + if (isHidden) { + console.log(`[API] Skipping system/hidden directory: ${item.name}`); + return false; + } + return true; }) .map(item => { // Try to find a profile pic or first image for the thumbnail diff --git a/src/App.tsx b/src/App.tsx index 602c677..018555d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -113,6 +113,7 @@ interface ServerArchive { const ArchiveDashboard = ({ archives, + localArchives = [], cachedArchives, onSelect, onLocalSelect, @@ -120,6 +121,7 @@ const ArchiveDashboard = ({ isScanning }: { archives: ServerArchive[]; + localArchives?: any[]; cachedArchives: Set; onSelect: (archive: ServerArchive) => void; onLocalSelect: () => void; @@ -155,7 +157,7 @@ const ArchiveDashboard = ({ {archives.map((archive) => { const isCached = cachedArchives.has(archive.name); return ( -
+
); })} + + {/* Local Cached Archives */} + {localArchives.map((archive) => ( +
+ + +
+ ))}
); @@ -278,7 +321,7 @@ const StoryViewer = ({ initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} - className="fixed inset-0 z-[100] bg-[#1a1a1a] flex items-center justify-center overflow-hidden" + className="fixed inset-0 z-[100] bg-[#1a1a1a] flex items-center justify-center overflow-hidden text-white" onClick={onClose} >
@@ -358,7 +401,7 @@ const StoryViewer = ({
-
+
{story.media[0].type === 'video' ? (