fix: unscrew titleAlreadyExists check

This commit is contained in:
zkldi
2022-10-30 19:25:01 +00:00
parent d36d641c2a
commit c0fad59749
@@ -131,29 +131,29 @@ async function ParseIIDXMDB() {
continue;
}
const titleAlreadyExists = songTitleMap.get(inp.title);
if (titleAlreadyExists) {
logger.warn(
`A song called '${inp.title}' already exists in songs-iidx. Is this a duplicate with a different inGameID?`
);
if (!options.force) {
logger.warn(
`Must be resolved manually. Use --force to blindly overwrite it anyway.`
);
continue;
} else {
logger.warn(`--force provided, adding it to the DB anyway.`);
}
}
const anySongIDMatch = chartMap.get(inp.songID);
let song: SongDocument<"iidx">;
if (!anySongIDMatch) {
// new song?
const titleAlreadyExists = songTitleMap.get(inp.title);
if (titleAlreadyExists) {
logger.warn(
`A song called '${inp.title}' already exists in songs-iidx (songID:${titleAlreadyExists.id}). Is this a duplicate with a different inGameID?`
);
if (!options.force) {
logger.warn(
`Must be resolved manually. Use --force to blindly overwrite it anyway.`
);
continue;
} else {
logger.warn(`--force provided, adding it to the DB anyway.`);
}
}
const searchTerms = [inp.genre];
if (inp.marquee.toLowerCase() !== inp.title.toLowerCase()) {
searchTerms.push(inp.marquee);