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 }; }