WI entries with world name obj format

- Changed format of WI entry objects for debugging purposes. Moved the world name right after uid, so it looks better in debugger
This commit is contained in:
Wolfsblvt 2024-07-05 20:50:30 +02:00
parent dfa2236fba
commit 56c6955f23
1 changed files with 3 additions and 3 deletions

View File

@ -3445,7 +3445,7 @@ async function getCharacterLore() {
} }
const data = await loadWorldInfoData(worldName); const data = await loadWorldInfoData(worldName);
const newEntries = data ? Object.keys(data.entries).map((x) => data.entries[x]).map(x => ({ ...x, world: worldName })) : []; const newEntries = data ? Object.keys(data.entries).map((x) => data.entries[x]).map(({ uid, ...rest }) => ({ uid, world: worldName, ...rest })) : [];
entries = entries.concat(newEntries); entries = entries.concat(newEntries);
if (!newEntries.length) { if (!newEntries.length) {
@ -3465,7 +3465,7 @@ async function getGlobalLore() {
let entries = []; let entries = [];
for (const worldName of selected_world_info) { for (const worldName of selected_world_info) {
const data = await loadWorldInfoData(worldName); const data = await loadWorldInfoData(worldName);
const newEntries = data ? Object.keys(data.entries).map((x) => data.entries[x]).map(x => ({ ...x, world: worldName })) : []; const newEntries = data ? Object.keys(data.entries).map((x) => data.entries[x]).map(({ uid, ...rest }) => ({ uid, world: worldName, ...rest })) : [];
entries = entries.concat(newEntries); entries = entries.concat(newEntries);
} }
@ -3487,7 +3487,7 @@ async function getChatLore() {
} }
const data = await loadWorldInfoData(chatWorld); const data = await loadWorldInfoData(chatWorld);
const newEntries = data ? Object.keys(data.entries).map((x) => data.entries[x]).map(x => ({ ...x, world: chatWorld })) : []; const entries = data ? Object.keys(data.entries).map((x) => data.entries[x]).map(({ uid, ...rest }) => ({ uid, world: chatWorld, ...rest })) : [];
console.debug(`[WI] Chat lore has ${entries.length} entries`, [chatWorld]); console.debug(`[WI] Chat lore has ${entries.length} entries`, [chatWorld]);