Create date fix

This commit is contained in:
SillyLossy
2023-03-12 14:33:45 +02:00
parent 76f0e892a4
commit b01bf57fda

View File

@@ -520,7 +520,7 @@ function checkServer(){
//***************** Main functions //***************** Main functions
function charaFormatData(data){ function charaFormatData(data){
var char = {"name": data.ch_name, "description": data.description, "personality": data.personality, "first_mes": data.first_mes, "avatar": 'none', "chat": data.ch_name+' - '+humanizedISO8601DateTime(), "mes_example": data.mes_example, "scenario": data.scenario, "create_date": humanizedISO8601DateTime, "talkativeness": data.talkativeness}; var char = {"name": data.ch_name, "description": data.description, "personality": data.personality, "first_mes": data.first_mes, "avatar": 'none', "chat": data.ch_name+' - '+humanizedISO8601DateTime(), "mes_example": data.mes_example, "scenario": data.scenario, "create_date": humanizedISO8601DateTime(), "talkativeness": data.talkativeness};
return char; return char;
} }
app.post("/createcharacter", urlencodedParser, function(request, response){ app.post("/createcharacter", urlencodedParser, function(request, response){
@@ -1162,12 +1162,12 @@ app.post("/importcharacter", urlencodedParser, async function(request, response)
if(jsonData.name !== undefined){ if(jsonData.name !== undefined){
png_name = getPngName(jsonData.name); png_name = getPngName(jsonData.name);
let char = {"name": jsonData.name, "description": jsonData.description ?? '', "personality": jsonData.personality ?? '', "first_mes": jsonData.first_mes ?? '', "avatar": 'none', "chat": humanizedISO8601DateTime(), "mes_example": jsonData.mes_example ?? '', "scenario": jsonData.scenario ?? '', "create_date": humanizedISO8601DateTime, "talkativeness": jsonData.talkativeness ?? 0.5}; let char = {"name": jsonData.name, "description": jsonData.description ?? '', "personality": jsonData.personality ?? '', "first_mes": jsonData.first_mes ?? '', "avatar": 'none', "chat": humanizedISO8601DateTime(), "mes_example": jsonData.mes_example ?? '', "scenario": jsonData.scenario ?? '', "create_date": humanizedISO8601DateTime(), "talkativeness": jsonData.talkativeness ?? 0.5};
char = JSON.stringify(char); char = JSON.stringify(char);
charaWrite('./public/img/fluffy.png', char, png_name, response, {file_name: png_name}); charaWrite('./public/img/fluffy.png', char, png_name, response, {file_name: png_name});
}else if(jsonData.char_name !== undefined){//json Pygmalion notepad }else if(jsonData.char_name !== undefined){//json Pygmalion notepad
png_name = getPngName(jsonData.char_name); png_name = getPngName(jsonData.char_name);
let char = {"name": jsonData.char_name, "description": jsonData.char_persona ?? '', "personality": '', "first_mes": jsonData.char_greeting ?? '', "avatar": 'none', "chat": humanizedISO8601DateTime(), "mes_example": jsonData.example_dialogue ?? '', "scenario": jsonData.world_scenario ?? '', "create_date": humanizedISO8601DateTime, "talkativeness": jsonData.talkativeness ?? 0.5}; let char = {"name": jsonData.char_name, "description": jsonData.char_persona ?? '', "personality": '', "first_mes": jsonData.char_greeting ?? '', "avatar": 'none', "chat": humanizedISO8601DateTime(), "mes_example": jsonData.example_dialogue ?? '', "scenario": jsonData.world_scenario ?? '', "create_date": humanizedISO8601DateTime(), "talkativeness": jsonData.talkativeness ?? 0.5};
char = JSON.stringify(char); char = JSON.stringify(char);
charaWrite('./public/img/fluffy.png', char, png_name, response, {file_name: png_name}); charaWrite('./public/img/fluffy.png', char, png_name, response, {file_name: png_name});
}else{ }else{
@@ -1183,7 +1183,7 @@ app.post("/importcharacter", urlencodedParser, async function(request, response)
png_name = getPngName(jsonData.name); png_name = getPngName(jsonData.name);
if(jsonData.name !== undefined){ if(jsonData.name !== undefined){
let char = {"name": jsonData.name, "description": jsonData.description ?? '', "personality": jsonData.personality ?? '', "first_mes": jsonData.first_mes ?? '', "avatar": 'none', "chat": humanizedISO8601DateTime(), "mes_example": jsonData.mes_example ?? '', "scenario": jsonData.scenario ?? '', "create_date": humanizedISO8601DateTime, "talkativeness": jsonData.talkativeness ?? 0.5}; let char = {"name": jsonData.name, "description": jsonData.description ?? '', "personality": jsonData.personality ?? '', "first_mes": jsonData.first_mes ?? '', "avatar": 'none', "chat": humanizedISO8601DateTime(), "mes_example": jsonData.mes_example ?? '', "scenario": jsonData.scenario ?? '', "create_date": humanizedISO8601DateTime(), "talkativeness": jsonData.talkativeness ?? 0.5};
char = JSON.stringify(char); char = JSON.stringify(char);
await charaWrite('./uploads/'+filedata.filename, char, png_name, response, {file_name: png_name}); await charaWrite('./uploads/'+filedata.filename, char, png_name, response, {file_name: png_name});
/* /*