From c323872a0f9813074c508d403362414317ed4aac Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 31 Mar 2026 19:28:45 -0400 Subject: [PATCH] debug: Add detailed logging to prproj analyzer Added debug output to analyzePrproj() to show: - All media blocks found in the project (uid, filePath, isGves, isProxy, title) - Complete proxy linkage map (which .gves UIDs link to which high-res UIDs) - Raw media blocks in analysis response (_debug_mediaBlocks) - Proxy links in analysis response (_debug_proxyLinks) Also added console.log output for all media blocks and proxy links to help diagnose why high-res blocks aren't being found/linked. Co-Authored-By: Claude Haiku 4.5 --- prproj-remapper.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/prproj-remapper.js b/prproj-remapper.js index 082b6b2..5a54cb9 100644 --- a/prproj-remapper.js +++ b/prproj-remapper.js @@ -339,6 +339,19 @@ async function analyzePrproj(prprojBuffer) { const gvesEntries = Object.values(mediaBlocks).filter(m => m.isGves); const hiresEntries = Object.values(mediaBlocks).filter(m => m.isProxy); + // Debug: log all media blocks found + console.log('=== DEBUG: All Media Blocks ==='); + Object.entries(mediaBlocks).forEach(([uid, block]) => { + console.log(`UID: ${uid}`); + console.log(` FilePath: ${block.filePath}`); + console.log(` IsGves: ${block.isGves}`); + console.log(` IsProxy: ${block.isProxy}`); + console.log(` Title: ${block.title}`); + console.log('---'); + }); + console.log('=== DEBUG: Proxy Links ==='); + console.log(JSON.stringify(proxyLinks, null, 2)); + // Deduplicate mappings by .gves path (multiple blocks can share the same path) const mappings = []; const seenGvesPaths = new Set(); @@ -363,6 +376,16 @@ async function analyzePrproj(prprojBuffer) { } } + // Debug: include all media blocks so we can see the structure + const allMediaBlocks = Object.entries(mediaBlocks).map(([uid, block]) => ({ + uid, + filePath: block.filePath, + isGves: block.isGves, + isProxy: block.isProxy, + title: block.title, + implementationID: block.implementationID + })); + return { totalMediaBlocks: Object.keys(mediaBlocks).length, gvesReferences: gvesEntries.length, @@ -370,7 +393,10 @@ async function analyzePrproj(prprojBuffer) { mappedPairs: mappings.length, unmappedGves: unmappedPaths.size, mappings, - hiresFormats: [...new Set(mappings.map(m => m.hiresExtension))] + hiresFormats: [...new Set(mappings.map(m => m.hiresExtension))], + // Debug: include raw media blocks + _debug_mediaBlocks: allMediaBlocks, + _debug_proxyLinks: proxyLinks }; }