feat(clone): add hotel field to clone source presets
CI / check (push) Successful in 26s
CI / release (push) Skipped
CI / deploy (push) Successful in 47s

- CloneSource interface now has a hotel field (maps to habbo_gamedata_hotel)
- DEFAULT_SOURCES presets include their associated hotel (it/com)
- When cloning from a source with a hotel configured, habbo_gamedata_hotel
  is set automatically so official furnidata enrichment uses the correct locale
- Clone source form UI now has a hotel select dropdown
- Source list shows the hotel label when configured
- Clone API route passes hotel through to upsertSource
This commit is contained in:
openhands committed 2026-08-05 16:21:45 +02:00
1 parent 79b82e0a31
commit 936053cca6
5 files changed
+53 -1

No files matched your search

+11
View File
@@ -2,6 +2,7 @@ import { promises as fs } from "node:fs";
import path from "node:path";
import { eq, inArray, sql } from "drizzle-orm";
import { db, ItemsBase } from "@/lib/db";
import { HABBO_GAMEDATA_HOTEL_SETTING_KEY } from "@/lib/habbo-gamedata-hotel";
import { logger } from "@/lib/logger";
import { extractFurniIconPng } from "@/lib/services/clone-icon";
import type { CloneSource } from "@/lib/services/clone-sources";
@@ -16,6 +17,7 @@ import {
} from "@/lib/services/furni-import";
import { browserHeaders } from "@/lib/services/import/core/browser-headers";
import { downloadFile } from "@/lib/services/import/core/download";
import { siteSettings } from "@/lib/services/site-settings";
import { parseNitroBundle } from "@/lib/services/swf/nitro-builder";
export interface SourceFurni {
@@ -221,6 +223,15 @@ export async function cloneSingleFurni(params: {
const { classname, itemType } = entry;
const warnings: string[] = [];
// Set the active Habbo hotel for official furnidata enrichment.
if (source.hotel) {
try {
await siteSettings.update(HABBO_GAMEDATA_HOTEL_SETTING_KEY, source.hotel);
} catch {
/* non-blocking */
}
}
// Path-traversal guard: classname comes from remote furnidata and is used to
// build file paths — reject anything that doesn't look like a safe furni name.
if (!/^[\w\-.*]+$/.test(classname)) {