Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dat with 1 game and many roms treats each rom as a separate game #1204

Closed
steveonjava opened this issue Jul 9, 2024 · 1 comment · Fixed by #1207
Closed

Dat with 1 game and many roms treats each rom as a separate game #1204

steveonjava opened this issue Jul 9, 2024 · 1 comment · Fixed by #1207
Assignees
Labels
bug A confirmed issues that needs fixing

Comments

@steveonjava
Copy link

steveonjava commented Jul 9, 2024

Paste the command

npx igir@latest copy test clean -vvv --dat "proper1g1r-collection/DATs/NEC - PC-88*/**/Retool.dat" --input "proper1g1r-collection/ROMs" --output "${OUTPUT}/{retrodeck}" --overwrite-invalid --no-bios

Describe the bug

When processing a DAT file that only has 1 game in it, hundreds of game entries are erroneously created. An example is given with a current export from no-intro DAT-o-MATIC of a DAT file for the NEC PC-88 (Flux).

Expected behavior

A DAT with 1 game in it should produce an output with a single game.

Debug logs

[20:16:14.815] TRACE: DATScanner: ../proper1g1r-collection/DATs/NEC - PC-88 (Flux)/NEC - PC-88 (Flux) (20220725-151518)
(Retool 2024-02-10 22-32-15) (1) (-y) [-aAbBcdkmMPpuv].dat: attempting to parse 108.1KB of XML
[20:16:14.835] TRACE: DATScanner: ../proper1g1r-collection/DATs/NEC - PC-88 (Flux)/NEC - PC-88 (Flux) (20220725-151518)
(Retool 2024-02-10 22-32-15) (1) (-y) [-aAbBcdkmMPpuv].dat: parsed XML, deserializing to DAT
[20:16:14.859] TRACE: DATScanner: ../proper1g1r-collection/DATs/NEC - PC-88 (Flux)/NEC - PC-88 (Flux) (20220725-151518)
(Retool 2024-02-10 22-32-15) (1) (-y) [-aAbBcdkmMPpuv].dat: 153.4MB of 672 games, 672 parents parsed

DAT(s) used

https://archive.org/download/proper1g1r-collection/DATs/NEC%20-%20PC-88%20%28Flux%29.zip/NEC%20-%20PC-88%20%28Flux%29%2FNEC%20-%20PC-88%20%28Flux%29%20%2820220725-151518%29.dat

igir version

v2.9.1

Node.js version

v22.4.0

Operating system

Ubuntu

Additional context

modules/datScanner.ts has a special case for treating a DAT file with 1 game as multiple games in order to work with libretro bios files. But this breaks the case when a DAT file only has 1 game like the no-intro NEC - PC-88 (Flux) set.

Here is the relevant code that breaks this case (datScanner.ts lines 56 through 65):

    // Special case: if the DAT has only one game but a large number of ROMs, assume each of those
    //  ROMs should be a separate game. This is to help parse the libretro BIOS System.dat file
    //  which only has one game for every BIOS file, even though there are 90+ consoles.
    if (dat.getGames().length === 1 && dat.getGames()[0].getRoms().length > 10) {
      const game = dat.getGames()[0];
      dat = new LogiqxDAT(dat.getHeader(), dat.getGames()[0].getRoms().map((rom) => game.withProps({
        name: rom.getName(),
        rom: [rom],
      })));
    }

The code should probably distinguish between game DATs and BIOS DATs to handle both cases differently.

@steveonjava steveonjava added the potential-bug A potential issue that needs confirmation and/or triage label Jul 9, 2024
@emmercm emmercm self-assigned this Jul 11, 2024
@emmercm emmercm added bug A confirmed issues that needs fixing and removed potential-bug A potential issue that needs confirmation and/or triage labels Jul 11, 2024
Copy link

🔒 Inactive issue lock

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Comment generated by the GitHub Lock Issues workflow.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug A confirmed issues that needs fixing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants