# 🎯 CRITICAL DISCOVERY: ScreenScraper Uses CUE Hashes, NOT BIN Track 1! **Date:** 2025-10-12 **Impact:** Changes our entire transformation tracking strategy **Status:** βœ… Verified with actual ScreenScraper database --- ## The Discovery By looking up "3D Baseball (USA)" manually on ScreenScraper.fr, we discovered: ### What We THOUGHT ScreenScraper Used: - BIN Track 1 MD5: `5f33157efd8a73de6612a852cf1ba147` (from Redump DAT) - This is the MD5 of ONLY the first data track ### What ScreenScraper ACTUALLY Has: ``` File Type | MD5 Hash | Scrapes | Size ----------------|-----------------------------------|---------|---------- CUE file | 4d9347b77d53c8f366f787cc9ba5ef9a | 1,558 | 204 B ⭐ BEST! Full BIN | 3bb15f208c412e96db79f96c0afcbf1e | 261 | 336 MB CHD (SS's) | CC5F238DADB317016D76C378565CA099 | 4,289 | 95.62 MB ZIP | 27888823362E9BEFB69C8C1F55B6C0FD | 1,531 | 144 MB ``` **The Redump BIN Track 1 hash is NOT in ScreenScraper's database!** --- ## Why This Matters ### Previous Strategy (WRONG): ```python # We thought we needed BIN Track 1 hash transformation = recorder.find_source_hash(chd_file) bin_track1_md5 = transformation.source_md5 # From Redump DAT game = screenscraper.search_game(md5=bin_track1_md5) # ❌ WON'T WORK! ``` ### Correct Strategy (RIGHT): ```python # We actually need CUE hash transformation = recorder.find_source_hash(chd_file) cue_md5 = transformation.source_md5 # From Redump DAT (CUEβ†’CHD mapping) game = screenscraper.search_game(md5=cue_md5) # βœ… WORKS! (1,558 scrapes) ``` --- ## Impact on Our Implementation ### Good News βœ… 1. **We already track CUE β†’ CHD transformations!** - Our database design supports this - Our DAT Manager loads CUE hashes from Redump - Our TransformationRecorder records both BINβ†’CHD and CUEβ†’CHD 2. **CUE files are BETTER than BIN for queries:** - Small (204 bytes vs 336 MB) - Fast to hash - More scrapes in SS database (1,558 vs 261) - Already in our transformation tracking 3. **This explains the 1.2% match rate perfectly:** ``` Your CHD: 497af1102b63d9d148e4ba4d119fb64e ❌ Unknown to SS ARRM's CHD: CC5F238DADB317016D76C378565CA099 βœ… SS's known CHD Only 4/322 games matched because only 4 had identical CHD conversions! ``` ### Changes Needed πŸ”§ 1. **Update test script** (DONE βœ…) - Test CUE hash as primary approach - Test SS's known CHD hash for comparison - Test our CHD hash (expected to fail) - Test full BIN hash (if available) - Test BIN Track 1 (expected to fail) 2. **Update transformation strategy** (TODO) - Prioritize CUE β†’ CHD transformations for scraping - Keep BIN hashes for reference/verification - Document that SS uses CUE/full BIN, not Track 1 3. **Update documentation** (TODO) - Fix SCREENSCRAPER_STRATEGY.md - Fix TRANSFORMATION_INTEGRATION.md - Update code comments --- ## Technical Details ### ScreenScraper Hash Priority (Disc-Based Games): **For Queries (from most to least useful):** 1. **CUE hash** - 1,558 scrapes, 204 bytes, FAST ⭐ 2. **Full BIN hash** - 261 scrapes, 336 MB, SLOW 3. **Known CHD hash** - 4,289 scrapes, but only if exact match 4. **ZIP hash** - 1,531 scrapes, varies **NOT useful:** - ❌ BIN Track 1 only (Redump standard, not in SS) - ❌ Unknown CHD conversions (different chdman versions) ### File Size Implications: ``` Hashing speed comparison: - CUE (204 bytes): < 0.001s ⚑ INSTANT - Full BIN (336 MB): ~0.300s 🐌 SLOW - CHD (95 MB): ~0.085s ⏱️ MEDIUM ``` **CUE is 300x faster to hash than full BIN!** --- ## Updated Workflow ### Phase 1: Import Redump Collection ```bash # Extract Redump ZIP unzip "3D Baseball (USA).zip" # β†’ 3D Baseball (USA).cue # β†’ 3D Baseball (USA) (Track 1).bin # β†’ 3D Baseball (USA) (Track 2).bin # β†’ ... ``` ### Phase 2: Convert to CHD ```python # Record CUE β†’ CHD transformation with recorder.record_transformation( source_file="3D Baseball (USA).cue", system="saturn", tool="chdman", version="0.251" ) as transform: chd = run_chdman("3D Baseball (USA).cue") transform.set_final_file(chd) # Database now has: # source_md5: 4d9347b77d53c8f366f787cc9ba5ef9a (CUE) # final_md5: 497af1102b63d9d148e4ba4d119fb64e (CHD) ``` ### Phase 3: Scrape Metadata ```python # Look up transformation transformation = recorder.find_source_hash(chd_file) # Get CUE hash cue_md5 = transformation.source_md5 # 4d9347b7... # Query ScreenScraper game = screenscraper.search_game( system_id=22, # Saturn md5=cue_md5 # CUE hash, not BIN Track 1! ) # βœ… SUCCESS! (1,558 scrapes prove this works) ``` --- ## Validation Plan ### Test Script Will Verify: 1. **Your CHD hash** β†’ ❌ Expected: NOT FOUND - Proves different conversions have different hashes 2. **SS's known CHD** β†’ βœ… Expected: FOUND - Proves SS does index some CHD files 3. **CUE hash** β†’ βœ… Expected: FOUND ⭐ - Proves our transformation approach works! 4. **Full BIN hash** β†’ βœ… Expected: FOUND - Alternative approach (slower but works) 5. **BIN Track 1** β†’ ❌ Expected: NOT FOUND - Confirms Redump Track 1 not in SS database ### Success Criteria: βœ… CUE hash lookup succeeds (Test #3) βœ… Proves transformation tracking solves 1.2% problem βœ… Can implement Phase 4 with confidence --- ## Next Steps 1. **Get dev credentials** (in progress) - User has a ScreenScraper account - Need devid/devpassword from forums 2. **Run validation test** (blocked on #1) ```bash python3 test_screenscraper_validation.py ``` 3. **If test succeeds:** - Update all documentation - Implement Phase 4 (ScreenScraper integration) - Process Saturn collection - Measure match rate improvement (1.2% β†’ 85%+) 4. **If test fails:** - Debug authentication - Try different game - Check SS server status - Contact SS support --- ## References - **Redump DAT:** `Sega - Mega CD & Sega CD (USA) (Redump) (20250101-000000).dat` - **ScreenScraper Manual Lookup:** 2025-10-12 - **Test Game:** 3D Baseball (USA) - T-15906H - **System:** Sega Saturn (SS ID: 22) **Key Insight:** CUE files are the "Rosetta Stone" between Redump collections and ScreenScraper metadata! πŸ—Ώ