igir
Version:
🕹 A zero-setup ROM collection manager that sorts, filters, extracts or archives, patches, and reports on collections of any size on any OS.
42 lines (41 loc) • 1.76 kB
TypeScript
import ProgressBar from '../../console/progressBar.js';
import DAT from '../../types/dats/dat.js';
import IndexedFiles from '../../types/indexedFiles.js';
import Options from '../../types/options.js';
import WriteCandidate from '../../types/writeCandidate.js';
import Module from '../module.js';
/**
* For every {@link Game} in a {@link DAT}, look for its {@link ROM}s in the scanned ROM list,
* and return a set of candidate files.
*/
export default class CandidateGenerator extends Module {
private static readonly THREAD_SEMAPHORE;
private readonly options;
constructor(options: Options, progressBar: ProgressBar);
/**
* Generate the candidates.
*/
generate(dat: DAT, indexedFiles: IndexedFiles): Promise<WriteCandidate[]>;
private buildCandidatesForGame;
private getInputFilesForGame;
private buildRomRomWithFilesPairs;
private shouldGenerateArchiveFile;
private getOutputFile;
private logMissingRomFiles;
private hasConflictingOutputFiles;
/**
* Given a {@link Game}, return true if all conditions are met:
* - The {@link Game} only has .bin and .cue files
* - Out of the {@link ROM}s that were found in an input directory for the {@link Game}, every
* .bin was found but at least one .cue file is missing
* This is only relevant when we are raw-copying CHD files, where it is difficult to ensure that
* the .cue file is accurate.
*/
private static onlyCueFilesMissingFromChd;
private hasExcessFiles;
/**
* Given an input {@link archive} and a set of {@link inputFiles} that match to a {@link ROM} from
* a {@link Game}, determine if every entry from the {@link archive} was matched.
*/
private findArchiveUnusedEntryPaths;
}