fix: missing uid in bili_user causes undefined reference
This commit is contained in:
parent
f7e71c22f6
commit
012887d1d9
@ -31,15 +31,19 @@ export async function getVideoInfoFromAllData(client: Client, aid: number) {
|
|||||||
[aid],
|
[aid],
|
||||||
);
|
);
|
||||||
const row = queryResult.rows[0];
|
const row = queryResult.rows[0];
|
||||||
const q = await client.queryObject<BiliUserType>(
|
let authorInfo = "";
|
||||||
`SELECT * FROM bili_user WHERE uid = $1`,
|
if (row.uid && await userExistsInBiliUsers(client, row.uid)) {
|
||||||
[row.uid],
|
const q = await client.queryObject<BiliUserType>(
|
||||||
)
|
`SELECT * FROM bili_user WHERE uid = $1`,
|
||||||
const userRow = q.rows[0];
|
[row.uid],
|
||||||
|
)
|
||||||
|
const userRow = q.rows[0];
|
||||||
|
authorInfo = userRow.desc;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
title: row.title,
|
title: row.title,
|
||||||
description: row.description,
|
description: row.description,
|
||||||
tags: row.tags,
|
tags: row.tags,
|
||||||
author_info: userRow.desc
|
author_info: authorInfo
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user