fix: map furni imports to production gamedata
This commit is contained in:
1 parent
a81af2d71a
commit
01570874a8
6 files changed
+224
-15
No files matched your search
@@ -1,6 +1,9 @@
|
||||
import { existsSync, promises as fs } from "node:fs";
|
||||
import path from "node:path";
|
||||
import { getNitroFilesRoot } from "@/lib/services/furni-asset-dirs";
|
||||
import {
|
||||
getGamedataRoot,
|
||||
getNitroFilesRoot,
|
||||
} from "@/lib/services/furni-asset-dirs";
|
||||
import type { HabboItFurniEntry } from "@/lib/services/habbo-furnidata-cache";
|
||||
import { siteSettings } from "@/lib/services/site-settings";
|
||||
import type { FurniMetadata } from "@/lib/services/swf-to-nitro";
|
||||
@@ -31,7 +34,10 @@ async function getFurnitureDataWritePaths(): Promise<string[]> {
|
||||
const primary = await getFurnitureDataPath();
|
||||
const configuredMirror =
|
||||
(await siteSettings.get("furni_data_mirror_path", "")) ?? "";
|
||||
const nitroFilesRoot = await getNitroFilesRoot();
|
||||
const [nitroFilesRoot, gamedataRoot] = await Promise.all([
|
||||
getNitroFilesRoot(),
|
||||
getGamedataRoot(),
|
||||
]);
|
||||
const mirror = configuredMirror.trim()
|
||||
? configuredMirror
|
||||
: nitroFilesRoot
|
||||
@@ -41,7 +47,15 @@ async function getFurnitureDataWritePaths(): Promise<string[]> {
|
||||
)
|
||||
: "";
|
||||
|
||||
const paths = [primary, mirror].filter(Boolean).map((p) => path.normalize(p));
|
||||
const gamedataPath = gamedataRoot
|
||||
? path.join(
|
||||
/*turbopackIgnore: true*/ gamedataRoot,
|
||||
"config/FurnitureData.json",
|
||||
)
|
||||
: "";
|
||||
const paths = [primary, mirror, gamedataPath]
|
||||
.filter(Boolean)
|
||||
.map((p) => path.normalize(p));
|
||||
const seen = new Set<string>();
|
||||
return paths.filter((p) => {
|
||||
const key = process.platform === "win32" ? p.toLowerCase() : p;
|
||||
|
||||
Reference in new issue
Block a user