mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
new db update fix
This commit is contained in:
@@ -278,8 +278,16 @@ function isQuestionValid(question: Question) {
|
||||
return true
|
||||
}
|
||||
|
||||
export function shouldSearchDataFile(df: DataFile, testUrl: string): Boolean {
|
||||
if (typeof df.shouldSearch === 'string' && df.shouldSearch === 'always') {
|
||||
export function shouldSearchDataFile(
|
||||
df: DataFile,
|
||||
testUrl: string,
|
||||
trueIfAlways?: Boolean
|
||||
): Boolean {
|
||||
if (
|
||||
typeof df.shouldSearch === 'string' &&
|
||||
df.shouldSearch === 'always' &&
|
||||
trueIfAlways
|
||||
) {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -329,7 +337,7 @@ export function loadJSON(
|
||||
dataDir: string
|
||||
): Array<QuestionDb> {
|
||||
return dataFiles.reduce((acc, dataFile, index) => {
|
||||
const dataPath = dataDir + '/' + dataFile.path
|
||||
const dataPath = dataDir + dataFile.path
|
||||
|
||||
if (!utils.FileExists(dataPath)) {
|
||||
utils.WriteFile(JSON.stringify([]), dataPath)
|
||||
|
Reference in New Issue
Block a user