diff --git a/package-lock.json b/package-lock.json index a510a277c..662fffa5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "firebotv5", - "version": "5.61.0", + "version": "5.61.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "firebotv5", - "version": "5.61.0", + "version": "5.61.1", "license": "GPL-3.0", "dependencies": { "@aws-sdk/client-polly": "^3.26.0", diff --git a/package.json b/package.json index ef526347b..f07ccf7ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "firebotv5", - "version": "5.61.0", + "version": "5.61.1", "description": "Powerful all-in-one bot for Twitch streamers.", "main": "build/main.js", "scripts": { diff --git a/src/backend/common/profile-manager.js b/src/backend/common/profile-manager.js index 4c5afff3d..4943007e6 100644 --- a/src/backend/common/profile-manager.js +++ b/src/backend/common/profile-manager.js @@ -161,11 +161,17 @@ const getJsonDbInProfile = function(filepath, humanReadable = true) { const jsonDbPath = getPathInProfile(filepath); try { - return new JsonDB(jsonDbPath, true, humanReadable); + const db = new JsonDB(jsonDbPath, true, humanReadable); + db.load(); + return db; } catch (error) { - logger.error(`Error loading JsonDB at ${filepath}. Attempting to recreate.`, error); + logger.error(`Error loading JsonDB at ${jsonDbPath}. Attempting to recreate.`); + + const fullPath = jsonDbPath.toLowerCase().endsWith(".json") + ? jsonDbPath + : `${jsonDbPath}.json`; - fs.rmSync(jsonDbPath, { force: true }); + fs.rmSync(fullPath, { force: true }); return new JsonDB(jsonDbPath, true, humanReadable); }