Skip to content

Commit

Permalink
Refactor: rename progress bar icon names (#1327)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm authored Aug 29, 2024
1 parent 27502fd commit b403669
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 26 deletions.
22 changes: 11 additions & 11 deletions src/console/progressBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ export const ProgressBarSymbol = {
DONE: chalk.green(process.platform === 'win32' ? '√' : '✓'),
// Files
FILE_SCANNING: chalk.magenta(process.platform === 'win32' ? '○' : '↻'),
FILE_DOWNLOADING: chalk.magenta('↓'),
DAT_DOWNLOADING: chalk.magenta('↓'),
DAT_PARSING: chalk.magenta('Σ'),
ROM_HASHING: chalk.magenta('#'),
ROM_HEADER_DETECTION: chalk.magenta('^'),
FILE_HASHING: chalk.magenta('#'),
FILE_INDEXING: chalk.magenta('#'),
ROM_INDEXING: chalk.magenta('♦'),
// Processing a single DAT
GROUPING_SIMILAR: chalk.cyan('∩'),
MERGE_SPLIT: chalk.cyan('↔'),
DAT_GROUPING_SIMILAR: chalk.cyan('∩'),
DAT_MERGE_SPLIT: chalk.cyan('↔'),
// Candidates
GENERATING: chalk.cyan('Σ'),
FILTERING: chalk.cyan('∆'),
EXTENSION_CORRECTION: chalk.cyan('.'),
CANDIDATE_HASHING: chalk.cyan('#'),
VALIDATING: chalk.cyan(process.platform === 'win32' ? '?' : '≟'),
COMBINING_ALL: chalk.cyan(process.platform === 'win32' ? 'U' : '∪'),
CANDIDATE_GENERATING: chalk.cyan('Σ'),
CANDIDATE_FILTERING: chalk.cyan('∆'),
CANDIDATE_EXTENSION_CORRECTION: chalk.cyan('.'),
CANDIDATE_HASHING: chalk.yellow('#'),
CANDIDATE_VALIDATING: chalk.cyan(process.platform === 'win32' ? '?' : '≟'),
CANDIDATE_COMBINING: chalk.cyan(process.platform === 'win32' ? 'U' : '∪'),
TESTING: chalk.yellow(process.platform === 'win32' ? '?' : '≟'),
WRITING: chalk.yellow(process.platform === 'win32' ? '»' : '✎'),
RECYCLING: chalk.blue(process.platform === 'win32' ? '»' : '♻'),
Expand Down
2 changes: 1 addition & 1 deletion src/modules/candidateCombiner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class CandidateCombiner extends Module {
}

this.progressBar.logTrace(`${dat.getNameShort()}: generating consolidated candidate`);
this.progressBar.setSymbol(ProgressBarSymbol.COMBINING_ALL);
this.progressBar.setSymbol(ProgressBarSymbol.CANDIDATE_COMBINING);
this.progressBar.reset(parentsToCandidates.size);

const game = CandidateCombiner.buildGame(dat, parentsToCandidates);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/candidateExtensionCorrector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class CandidateExtensionCorrector extends Module {
}

this.progressBar.logTrace(`${dat.getNameShort()}: correcting ${romsThatNeedCorrecting.toLocaleString()} output file extension${romsThatNeedCorrecting !== 1 ? 's' : ''}`);
this.progressBar.setSymbol(ProgressBarSymbol.EXTENSION_CORRECTION);
this.progressBar.setSymbol(ProgressBarSymbol.CANDIDATE_EXTENSION_CORRECTION);
this.progressBar.reset(romsThatNeedCorrecting);

const correctedParentsToCandidates = await this.correctExtensions(dat, parentsToCandidates);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/candidateGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class CandidateGenerator extends Module {
const parents = dat.getParents();

this.progressBar.logTrace(`${dat.getNameShort()}: generating candidates`);
this.progressBar.setSymbol(ProgressBarSymbol.GENERATING);
this.progressBar.setSymbol(ProgressBarSymbol.CANDIDATE_GENERATING);
this.progressBar.reset(parents.length);

// For each parent, try to generate a parent candidate
Expand Down
2 changes: 1 addition & 1 deletion src/modules/candidateMergeSplitValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class CandidateMergeSplitValidator extends Module {
}

this.progressBar.logTrace(`${dat.getNameShort()}: validating merged & split ROM sets`);
this.progressBar.setSymbol(ProgressBarSymbol.VALIDATING);
this.progressBar.setSymbol(ProgressBarSymbol.CANDIDATE_VALIDATING);
this.progressBar.reset(parentsToCandidates.size);

const datGamesIndexed = dat.getGames().reduce((map, game) => {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/candidatePatchGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class CandidatePatchGenerator extends Module {
}

this.progressBar.logTrace(`${dat.getNameShort()}: generating patched candidates`);
this.progressBar.setSymbol(ProgressBarSymbol.GENERATING);
this.progressBar.setSymbol(ProgressBarSymbol.CANDIDATE_GENERATING);
this.progressBar.reset(parentsToCandidates.size);

const crcToPatches = CandidatePatchGenerator.indexPatchesByCrcBefore(patches);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/candidatePostProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class CandidatePostProcessor extends Module {
}

this.progressBar.logTrace(`${dat.getNameShort()}: processing candidates`);
this.progressBar.setSymbol(ProgressBarSymbol.GENERATING);
this.progressBar.setSymbol(ProgressBarSymbol.CANDIDATE_GENERATING);
this.progressBar.reset(parentsToCandidates.size);

// Get the output basename of every ROM
Expand Down
2 changes: 1 addition & 1 deletion src/modules/candidatePreferer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default class CandidatePreferer extends Module {
return parentsToCandidates;
}

this.progressBar.setSymbol(ProgressBarSymbol.FILTERING);
this.progressBar.setSymbol(ProgressBarSymbol.CANDIDATE_FILTERING);
this.progressBar.reset(parentsToCandidates.size);

const output = this.sortAndFilter(dat, parentsToCandidates);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/candidateValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class CandidateValidator extends Module {
}

this.progressBar.logTrace(`${dat.getNameShort()}: validating candidates`);
this.progressBar.setSymbol(ProgressBarSymbol.VALIDATING);
this.progressBar.setSymbol(ProgressBarSymbol.CANDIDATE_VALIDATING);
this.progressBar.reset(parentsToCandidates.size);

const conflictedOutputPaths = this.validateUniqueOutputPaths(dat, parentsToCandidates);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/datFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class DATFilter extends Module {
}

this.progressBar.logTrace(`${dat.getNameShort()}: filtering DAT`);
this.progressBar.setSymbol(ProgressBarSymbol.FILTERING);
this.progressBar.setSymbol(ProgressBarSymbol.CANDIDATE_FILTERING);
this.progressBar.reset(dat.getGames().length);

const filteredGames = dat.getParents().flatMap((parent) => {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/datMergerSplitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class DATMergerSplitter extends Module {
}, new Map<string, Game>());

this.progressBar.logTrace(`${dat.getNameShort()}: merging & splitting ${dat.getGames().length.toLocaleString()} game${dat.getGames().length !== 1 ? 's' : ''}`);
this.progressBar.setSymbol(ProgressBarSymbol.MERGE_SPLIT);
this.progressBar.setSymbol(ProgressBarSymbol.DAT_MERGE_SPLIT);
this.progressBar.reset(dat.getGames().length);

const newGames = dat.getParents()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/datParentInferrer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class DATParentInferrer extends Module {
}

this.progressBar.logTrace(`${dat.getNameShort()}: inferring parents for ${dat.getGames().length.toLocaleString()} game${dat.getGames().length !== 1 ? 's' : ''}`);
this.progressBar.setSymbol(ProgressBarSymbol.GROUPING_SIMILAR);
this.progressBar.setSymbol(ProgressBarSymbol.DAT_GROUPING_SIMILAR);
this.progressBar.reset(dat.getGames().length);

// Group games by their stripped names
Expand Down
2 changes: 1 addition & 1 deletion src/modules/datScanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default class DATScanner extends Scanner {
}

this.progressBar.logTrace('downloading DATs from URLs');
this.progressBar.setSymbol(ProgressBarSymbol.FILE_DOWNLOADING);
this.progressBar.setSymbol(ProgressBarSymbol.DAT_DOWNLOADING);

return (await Promise.all(datFiles.map(async (datFile) => {
if (!datFile.isURL()) {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/movedRomDeleter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class MovedROMDeleter extends Module {
}

this.progressBar.logTrace('deleting moved ROMs');
this.progressBar.setSymbol(ProgressBarSymbol.FILTERING);
this.progressBar.setSymbol(ProgressBarSymbol.CANDIDATE_FILTERING);
this.progressBar.reset(movedRoms.length);

const fullyConsumedFiles = this.filterOutPartiallyConsumedArchives(movedRoms, inputRoms);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/romIndexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class ROMIndexer extends Module {
*/
index(files: File[]): IndexedFiles {
this.progressBar.logTrace(`indexing ${files.length.toLocaleString()} file${files.length !== 1 ? 's' : ''}`);
this.progressBar.setSymbol(ProgressBarSymbol.FILE_INDEXING);
this.progressBar.setSymbol(ProgressBarSymbol.ROM_INDEXING);
this.progressBar.reset(files.length);

// Index the files
Expand Down
2 changes: 1 addition & 1 deletion src/modules/romScanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class ROMScanner extends Scanner {
this.progressBar.incrementTotal(increment);
});
this.progressBar.logTrace(`found ${romFilePaths.length.toLocaleString()} ROM file${romFilePaths.length !== 1 ? 's' : ''}`);
this.progressBar.setSymbol(ProgressBarSymbol.FILE_HASHING);
this.progressBar.setSymbol(ProgressBarSymbol.ROM_HASHING);
this.progressBar.reset(romFilePaths.length);

const files = await this.getFilesFromPaths(
Expand Down

0 comments on commit b403669

Please sign in to comment.