diff --git a/lib/db/allData.ts b/lib/db/allData.ts index 82e1654..7c4d990 100644 --- a/lib/db/allData.ts +++ b/lib/db/allData.ts @@ -48,3 +48,17 @@ export async function getVideoInfoFromAllData(client: Client, aid: number) { author_info: authorInfo }; } + +export async function getUnArchivedBiliUsers(client: Client) { + const queryResult = await client.queryObject<{uid: number}>( + ` + SELECT ad.uid + FROM all_data ad + LEFT JOIN bili_user bu ON ad.uid = bu.uid + WHERE bu.uid IS NULL; + `, + [] + ); + const rows = queryResult.rows; + return rows.map((row) => row.uid); +} diff --git a/lib/mq/exec/getBiliUserInfo.ts b/lib/mq/exec/getBiliUserInfo.ts new file mode 100644 index 0000000..e69de29