mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-09 07:09:57 +03:00
Add initfolderchartlookup handling
This commit is contained in:
@@ -12,6 +12,7 @@ import { ICollection } from "monk";
|
||||
import os from "os";
|
||||
import path from "path";
|
||||
import { ChartDocument, FolderDocument, SongDocument, TableDocument } from "tachi-common";
|
||||
import { InitaliseFolderChartLookup } from "utils/folder";
|
||||
|
||||
interface SyncInstructions {
|
||||
pattern: RegExp;
|
||||
@@ -147,6 +148,7 @@ const syncInstructions: SyncInstructions[] = [
|
||||
|
||||
if (bwriteOps.length) {
|
||||
await collection.bulkWrite(bwriteOps);
|
||||
await InitaliseFolderChartLookup();
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -8,6 +8,7 @@ import CreateLogCtx from "lib/logger/logger";
|
||||
import { Environment, ServerConfig, ServerTypeInfo } from "lib/setup/config";
|
||||
import path from "path";
|
||||
import server from "server/server";
|
||||
import { InitaliseFolderChartLookup } from "utils/folder";
|
||||
import { FormatVersion } from "./lib/constants/version";
|
||||
|
||||
const logger = CreateLogCtx(__filename);
|
||||
@@ -30,6 +31,13 @@ db.users.indexes().then((r) => {
|
||||
}
|
||||
});
|
||||
|
||||
db["folder-chart-lookup"].findOne().then((r) => {
|
||||
// If there are no folder chart lookups, initialise them.
|
||||
if (!r) {
|
||||
InitaliseFolderChartLookup();
|
||||
}
|
||||
});
|
||||
|
||||
if (ServerConfig.ENABLE_SERVER_HTTPS) {
|
||||
logger.warn(
|
||||
"HTTPS Mode is enabled. This should not be used in production, and you should instead run behind a reverse proxy."
|
||||
|
||||
Reference in New Issue
Block a user