diff --git a/server/package.json b/server/package.json index aa820c62b..3534177cb 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "tachi-server", - "version": "2.1.13", + "version": "2.1.14", "description": "A score tracking server.", "main": "js/index.js", "private": true, diff --git a/server/src/lib/constants/version.ts b/server/src/lib/constants/version.ts index 027b030cf..faf503505 100644 --- a/server/src/lib/constants/version.ts +++ b/server/src/lib/constants/version.ts @@ -4,7 +4,7 @@ const MAJOR = 2; const MINOR = 1; -const PATCH = 13; +const PATCH = 14; // As is with all front-facing zkldi projects, the version names for tachi-server // are from an album I like. In this case, the album is Portishead - Dummy. diff --git a/server/src/scripts/sync-database.ts b/server/src/scripts/sync-database.ts index 74f47741b..27af3cd43 100644 --- a/server/src/scripts/sync-database.ts +++ b/server/src/scripts/sync-database.ts @@ -1,7 +1,7 @@ /* eslint-disable no-await-in-loop */ // This script syncs this tachi instances database up with the tachi-database-seeds. -import db, { monkDB } from "external/mongo/db"; +import { monkDB } from "external/mongo/db"; import fjsh from "fast-json-stable-hash"; import { PullDatabaseSeeds } from "lib/database-seeds/repo"; import CreateLogCtx, { KtLogger } from "lib/logger/logger"; @@ -202,7 +202,13 @@ const syncInstructions: SyncInstructions[] = [ collection: ICollection, logger ) => { - const r = await GenericUpsert(folders, collection, "folderID", logger, true); + const r = await GenericUpsert( + folders.filter((e) => TachiConfig.GAMES.includes(e.game)), + collection, + "folderID", + logger, + true + ); if (r) { await InitaliseFolderChartLookup(); @@ -212,15 +218,27 @@ const syncInstructions: SyncInstructions[] = [ { pattern: /^tables/u, handler: (tables: TableDocument[], collection: ICollection, logger) => - GenericUpsert(tables, collection, "tableID", logger, true), + GenericUpsert( + tables.filter((e) => TachiConfig.GAMES.includes(e.game)), + collection, + "tableID", + logger, + true + ), }, { pattern: /^bms-course-lookup/u, - handler: ( + handler: async ( bmsCourseDocuments: BMSCourseDocument[], collection: ICollection, logger - ) => GenericUpsert(bmsCourseDocuments, collection, "md5sums", logger), + ) => { + if (TachiConfig.TYPE === "ktchi") { + return; + } + + await GenericUpsert(bmsCourseDocuments, collection, "md5sums", logger); + }, }, ];