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 <noreply@anthropic.com>
This commit is contained in:
Claude 2026-03-31 19:28:45 -04:00
parent a90177fd93
commit c323872a0f

View file

@ -339,6 +339,19 @@ async function analyzePrproj(prprojBuffer) {
const gvesEntries = Object.values(mediaBlocks).filter(m => m.isGves); const gvesEntries = Object.values(mediaBlocks).filter(m => m.isGves);
const hiresEntries = Object.values(mediaBlocks).filter(m => m.isProxy); 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) // Deduplicate mappings by .gves path (multiple blocks can share the same path)
const mappings = []; const mappings = [];
const seenGvesPaths = new Set(); 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 { return {
totalMediaBlocks: Object.keys(mediaBlocks).length, totalMediaBlocks: Object.keys(mediaBlocks).length,
gvesReferences: gvesEntries.length, gvesReferences: gvesEntries.length,
@ -370,7 +393,10 @@ async function analyzePrproj(prprojBuffer) {
mappedPairs: mappings.length, mappedPairs: mappings.length,
unmappedGves: unmappedPaths.size, unmappedGves: unmappedPaths.size,
mappings, 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
}; };
} }