mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Filter generic creator's note
Removes "Creator's notes go here." message when importing cards.
This commit is contained in:
11
server.js
11
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 ?? '',
|
||||
|
Reference in New Issue
Block a user