Skip to content

Updating/Cleanup importing process#96

Open
matthew-pye wants to merge 17 commits intorommapp:mainfrom
matthew-pye:main
Open

Updating/Cleanup importing process#96
matthew-pye wants to merge 17 commits intorommapp:mainfrom
matthew-pye:main

Conversation

@matthew-pye
Copy link
Contributor

@matthew-pye matthew-pye commented Mar 13, 2026

Updating/Clean up importing process and various additions + fixes

This is a big PR so I will leave it as a draft request for now, in case any issues get found and changes can be made. I have attached a debug build of the changes that have been tested in a windows sandbox.

I would of packed it into a .pext but I'm unsure how to do it correctly as when I do it get sharpcompress errors like this #74)

RomM-ImportRefactor.zip

With this being a big pull request I want to say that no AI was used in the creation of any of this code the only resources used were documentation, blind testing to see what works and a bit of stack overflow

Changes

Rework

Additions

Fixes

  • Replace the endpoint used for single file ROMs to /api/romfiles & /api/roms/files (For 4.8) as sometimes in previous versions a single .nsp file with dlc and update folders would download a zip of all the files but the plugin has only requested the single .nsp causing the install to think it had only downloaded the single file should fix [Bug] Switch NSPs and XCIs Within Folders Downloaded Incorrectly #37
  • Cleanup game revision merging and switching [Feature] Better handling of games with revisions #91
  • Fixed Installer never checking to see if m3u is supported by the emulator
  • Fixed 7z path not being saved correctly

New Settings Page

image

Other issues

I tried to tackle some of the other issue but may have already been fixed or I was unable to recreate

  • I tried installing a single ROM @ 13.9GB and multi-file ROM @ 14.4GB both succeeded [Bug] Error when installing large games (timeout) #47
  • I can get a 500 error when installing some unpacked Wii U ROMs but doesn't seem related to [Bug] Multifile directory trees break downloads #92
    [romm] 2026-03-13T15:35:31.978395884Z INFO: [RomM][rom][2026-03-13 15:35:31] User matt is downloading PAPER MARIO Color Splash
    [romm] 2026-03-13T15:35:32.053132741Z INFO: [RomM][httptools_impl][2026-03-13 15:35:32] 192.168.1.99:0 - "GET /api/roms/635/content/PAPER%20MARIO%20Color%20Splash HTTP/1.0" 200
    [romm] 2026-03-13T15:35:53.727227677Z 2026/03/13 15:35:53 [crit] 171#171: *144 open() "/romm/library/roms/Wii U/PAPER MARIO Color Splash/content/script/fld/map/G3/G3_LabOutside.bin.lz" failed (24: No file descriptors available), client: 192.168.1.99, server: localhost, request: "GET /api/roms/635/content/PAPER%20MARIO%20Color%20Splash HTTP/1.1", subrequest: "/library/roms/Wii U/PAPER MARIO Color Splash/content/script/fld/map/G3/G3_LabOutside.bin.lz", host: "192.168.1.100:1337"
    [romm] 2026-03-13T15:35:53.727270878Z 2026/03/13 15:35:53 [error] 171#171: *144 mod_zip: a subrequest returned 500, aborting..., client: 192.168.1.99, server: localhost, request: "GET /api/roms/635/content/PAPER%20MARIO%20Color%20Splash HTTP/1.1", subrequest: "/library/roms/Wii U/PAPER MARIO Color Splash/content/script/fld/map/G3/G3_LabOutside.bin.lz", host: "192.168.1.100:1337"
    [romm] 2026-03-13T15:35:53.727245067Z INFO: [RomM][nginx][2026-03-13 15:35:53] 192.168.1.99 | - | GET /api/roms/635/content/PAPER%20MARIO%20Color%20Splash 200 | 1010990977 | Unknown Unknown | 23.724

Testing

I have tested everything that I've written and changed all seem to be working, installing this version over a pervious one properly updates the gameId to the new Id and retains the users playtime data. It does require that the user to reselect the platform in there mappings.

- Added metadata provider class so users can download metadata in Playnite using the Official Store option
- Added: migration from old gameId to new gameId
- Added: option for user to keep game deleted from RomM server, if the same ROM is added back to the server it will update the Id
- Added :option to skip ROMs that are missing from RomM filesystem
- Added: option to filter out genres globally
- Bugfix: added GameInstallInfo so mapping stops being save multiple times per file
- Bugfix: fixed sibling filename being saved with base filename
- Bugfix: fixed Installer never checking to see if m3u is supported by the emulator
- Bugfix: 7z path not being saved correctly
@matthew-pye matthew-pye marked this pull request as ready for review March 17, 2026 10:33
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@matthew-pye matthew-pye marked this pull request as draft March 22, 2026 10:18
- Main: Fix platform name not being restored in UI
- Sub: Fix object ref error
- Sub: User profile data not being restored
- Sub: Spelling
@gantoine
Copy link
Member

@matthew-pye soon as this is ready set to ready for review and i'll have copilot take a look for ya

@matthew-pye
Copy link
Contributor Author

Sure, I was ready but noticed a few bugs when I started using it on my real Playnite instance instead of just a sandbox instance, It should be ready now. Ill fix any issues that arise tomorrow though.

@matthew-pye matthew-pye marked this pull request as ready for review March 22, 2026 21:48
@gantoine gantoine requested a review from Copilot March 22, 2026 22:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the RomM Playnite plugin’s import pipeline to use a new ImportGames flow (with local per-ROM JSON state keyed by RomMId:SHA1), expands settings/UI (platform sync, client token auth, new import options), and adds a RomM-backed metadata downloader.

Changes:

  • Replaces the legacy GetGames import with ImportGames via RomMImportController/RomMImport and switches to RomMId:SHA1 identifiers with local JSON state.
  • Updates settings UX and auth options (Basic Auth vs client token), plus new import/install toggles (keep deleted games, skip missing files, exclude genres, etc.).
  • Adds GetMetadataDownloader support and extends RomM models to include additional IDs/manuals/hash info.

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
Settings/SettingsView.xaml.cs Adds settings UI event handlers (test connection, platform sync, mapping add).
Settings/SettingsView.xaml Reworks the settings layout and adds new settings fields/options.
Settings/Settings.cs Expands settings model (auth/token/profile info, platform list, new flags) and adds server connection test logic.
Settings/EmulatorMapping.cs Refactors mapping model to use RomM platforms and new mapping UI fields.
RomM.csproj Updates content packaging (adds profile.png, adjusts icon.png item metadata).
RomM.cs Switches to ImportGames, adds metadata provider, revises local ROM data storage path, updates platform mapping usage.
IRomm.cs Updates plugin interface to support new import/metadata flows (Id/Source/FetchRom).
Games/RomMMetadataProvider.cs Adds RomM-backed metadata downloader implementation.
Games/RomMInstallController.cs Updates install controller to use locally saved ROM install info (incl. revision selection output).
Games/RomMImportController.cs Introduces import controller orchestrating platform fetch + per-mapping processing.
Games/RomMImport.cs Implements the new import processing, local JSON persistence, SHA1 fallback, and migration logic.
Games/RomMGameInfo.cs Adjusts install controller wiring to the new install-info model.
Downloads/VersionSelector.xaml.cs Switches revision selector to operate on GameInstallInfo instead of sibling DTOs.
Downloads/VersionSelector.xaml Updates bindings for the new revision selection model.
Models/RomM/RomMUser.cs Adds model for /api/users/me response.
Models/RomM/RomMHeartbeat.cs Adds model types for heartbeat/server version parsing.
Models/RomM/Rom/RomMRomUser.cs Adds is_main_sibling field support.
Models/RomM/Rom/RomMRomLocal.cs Adds local persisted ROM state model (base + sibling selection).
Models/RomM/Rom/RomMRom.cs Extends ROM model (file IDs, extra IDs, sha1/manual fields, processed flag).
Models/RomM/Platform/RomMPlatform.cs Adds equality overrides for platform objects.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gantoine gantoine self-requested a review March 23, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Switch NSPs and XCIs Within Folders Downloaded Incorrectly

3 participants