From d410118cc40224bbf78cb0fc675c2917daaabfb3 Mon Sep 17 00:00:00 2001 From: As4shi <24969000+As4shi@users.noreply.github.com> Date: Wed, 28 Jun 2023 04:47:01 -0300 Subject: [PATCH] Filter generic creator's note Removes "Creator's notes go here." message when importing cards. --- server.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 4cdb98a30..99ef75e08 100644 --- a/server.js +++ b/server.js @@ -1788,7 +1788,9 @@ app.post("/importcharacter", urlencodedParser, async function (request, response } else if (jsonData.name !== undefined) { console.log('importing from v1 json'); jsonData.name = sanitize(jsonData.name); - + if (jsonData.creator_notes) { + jsonData.creator_notes = jsonData.creator_notes.replace("Creator's notes go here.", ""); + } png_name = getPngName(jsonData.name); let char = { "name": jsonData.name, @@ -1811,7 +1813,9 @@ app.post("/importcharacter", urlencodedParser, async function (request, response } else if (jsonData.char_name !== undefined) {//json Pygmalion notepad console.log('importing from gradio json'); jsonData.char_name = sanitize(jsonData.char_name); - + if (jsonData.creator_notes) { + jsonData.creator_notes = jsonData.creator_notes.replace("Creator's notes go here.", ""); + } png_name = getPngName(jsonData.char_name); let char = { "name": jsonData.char_name, @@ -1866,6 +1870,9 @@ app.post("/importcharacter", urlencodedParser, async function (request, response } else if (jsonData.name !== undefined) { console.log('Found a v1 character file.'); console.log(jsonData); + if (jsonData.creator_notes) { + jsonData.creator_notes = jsonData.creator_notes.replace("Creator's notes go here.", ""); + } let char = { "name": jsonData.name, "description": jsonData.description ?? '',