diff --git a/server/src/score-import/framework/core/sessions/name-generation.ts b/server/src/score-import/framework/core/sessions/name-generation.ts index f6255cf64..68fee0e43 100644 --- a/server/src/score-import/framework/core/sessions/name-generation.ts +++ b/server/src/score-import/framework/core/sessions/name-generation.ts @@ -1,38 +1,9 @@ -import db from "../../../../db/db"; -import { KtLogger } from "../../../../types"; +import { GetRandomAdjective, GetRandomNoun } from "../../../../data/words"; -export async function GenerateRandomSessionName(logger: KtLogger) { - let adjectives = await db.adjectives.aggregate([ - { - $sample: { - size: 2, - }, - }, - ]); +export function GenerateRandomSessionName() { + let adj1 = GetRandomAdjective(); + let adj2 = GetRandomAdjective(); + let noun = GetRandomNoun(); - let nouns = await db.nouns.aggregate([ - { - $sample: { - size: 1, - }, - }, - ]); - - if (adjectives.length < 2) { - logger.severe( - `Could not source 2 adjectives from the adjectives DB. Filling in with defaults, but this should be investigated.` - ); - - adjectives = ["Ambient", "Scary"]; - } - - if (nouns.length < 1) { - logger.severe( - `Could not source a noun from the noun DB. Filling in with defaults, but this should be investigated.` - ); - - nouns = ["Noise"]; - } - - return `${adjectives[0].text} ${adjectives[1].text} ${nouns[0].text}`; + return `${adj1} ${adj2} ${noun}`; }