Filter generic creator's note

Removes "Creator's notes go here." message when importing cards.
This commit is contained in:
As4shi
2023-06-28 04:47:01 -03:00
committed by GitHub
parent 5084ae9f9a
commit d410118cc4

View File

@ -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 ?? '',