filter out disabled on latest and search

This commit is contained in:
localhost 2026-04-25 20:11:24 +02:00
parent d06a0e212a
commit 2a833c12b7
2 changed files with 6 additions and 4 deletions

View File

@ -14,6 +14,7 @@ app.get('/latest', async ({ set }) => {
} }
const json = await db.selectFrom('videos') const json = await db.selectFrom('videos')
.where('disabled', '=', false)
.select(['id', 'title', 'thumbnail', 'published', 'archived', 'channel', 'channelId', 'channelAvatar', 'channelVerified']) .select(['id', 'title', 'thumbnail', 'published', 'archived', 'channel', 'channelId', 'channelAvatar', 'channelVerified'])
.orderBy('archived desc') .orderBy('archived desc')
.limit(51) .limit(51)

View File

@ -32,6 +32,7 @@ app.get('/search', async ({ headers, query: { search }, set, redirect, error })
const videos = await db.selectFrom('videos') const videos = await db.selectFrom('videos')
.selectAll() .selectAll()
.where('title', 'ilike', `%${search}%`) .where('title', 'ilike', `%${search}%`)
.where('disabled', '=', false)
.execute() .execute()
const html = await m(eta.render('./search', { const html = await m(eta.render('./search', {