This commit is contained in:
cutestnekoaqua 2023-03-29 21:16:45 +02:00
parent 66429527ca
commit 2398aab82b
No known key found for this signature in database
GPG Key ID: 6BF0964A5069C1E0
1 changed files with 3 additions and 2 deletions

View File

@ -39,6 +39,7 @@ export async function importPosts(
try {
const parsed = JSON.parse(json);
if (parsed instanceof Array) {
logger.info("Parsing key style posts");
for (const post of JSON.parse(json)) {
try {
linenum++;
@ -78,7 +79,8 @@ export async function importPosts(
logger.warn(`Error in line:${linenum} ${e}`);
}
}
} else {
} else if (parsed instanceof Object) {
logger.info("Parsing animal style posts");
for (const post of parsed.orderedItems) {
try {
linenum++;
@ -112,7 +114,6 @@ export async function importPosts(
} catch (e) {
logger.warn(`Error in line:${linenum} ${e}`);
}
}
}
} catch (e) {