1
0

fix: unexpected hard-coding user ID

This commit is contained in:
alikia2x (寒寒) 2025-12-02 10:18:31 +08:00 committed by GitHub
parent bb01750816
commit 17004f47c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,7 +21,7 @@ const videoSchema = BiliVideoSchema.omit({ publishedAt: true })
export const getUnlabelledVideos = new Elysia({ prefix: "/videos" }).use(requireAuth).get(
"/unlabelled",
async () => {
async ({ user }) => {
return db.execute<z.infer<typeof videoSchema>>(sql`
SELECT bm.*, ls.views, bu.username, bu.uid
FROM (
@ -43,8 +43,8 @@ export const getUnlabelledVideos = new Elysia({ prefix: "/videos" }).use(require
WHERE aid IN (
SELECT aid
FROM internal.video_type_label
TABLESAMPLE SYSTEM (2)
WHERE user != 'i3wW8JdZ9sT3ASkk'
TABLESAMPLE SYSTEM (10)
WHERE user != ${user!.unqId}
ORDER BY RANDOM()
LIMIT 20
)