Backfill icons too in the Gamedata bundle sync
Extend the post-import backfill to also copy missing _icon.png files into /var/www/Gamedata/icons (in addition to nitros into bundled/furniture) so all imported furniture shows an icon in-game. Report copied nitros and icons separately in the API/SSE responses.
This commit is contained in:
1 parent
bcd24bfca4
commit
b4021f6b42
4 files changed
+99
-54
No files matched your search
@@ -9,7 +9,7 @@ import {
|
||||
ensureFurniOwnership,
|
||||
importSingleFurni,
|
||||
reconcileImportedOfferIds,
|
||||
syncNitrosToGamedataBundle,
|
||||
syncAssetsToGamedataBundle,
|
||||
} from "@/lib/services/furni-import";
|
||||
import { rcon } from "@/lib/services/rcon";
|
||||
import type { ImportSingleResult } from "@/types/furni";
|
||||
@@ -218,10 +218,13 @@ export const POST = withAdmin(
|
||||
let offerIdsFixed = 0;
|
||||
let ownershipFixed: string[] = [];
|
||||
let nitrosSynced: string[] = [];
|
||||
let iconsSynced: string[] = [];
|
||||
try {
|
||||
offerIdsFixed = (await reconcileImportedOfferIds()).fixed;
|
||||
ownershipFixed = (await ensureFurniOwnership()).fixed;
|
||||
nitrosSynced = (await syncNitrosToGamedataBundle()).copied;
|
||||
const assetsSynced = await syncAssetsToGamedataBundle();
|
||||
nitrosSynced = assetsSynced.copiedNitros;
|
||||
iconsSynced = assetsSynced.copiedIcons;
|
||||
} catch (err) {
|
||||
console.warn(
|
||||
"[import-furni] Post-import reconcile/ownership failed:",
|
||||
@@ -237,6 +240,7 @@ export const POST = withAdmin(
|
||||
offerIdsFixed,
|
||||
ownershipFixed,
|
||||
nitrosSynced,
|
||||
iconsSynced,
|
||||
duration: Date.now() - startTime,
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user