From 6391aa67c075876198ed92d2576d73b75f053a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=80=E1=B4=8D=E1=B4=9B=E1=B4=8F=E1=B4=80=E1=B4=87?= =?UTF-8?q?=CA=80?= Date: Fri, 5 Dec 2025 21:52:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E6=8C=89=E7=85=A7=20?= =?UTF-8?q?BV=20=E5=8F=B7=E6=90=9C=E7=B4=A2=20(#554)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/bili_sync/src/api/routes/videos/mod.rs | 6 +++++- web/src/routes/videos/+page.svelte | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/bili_sync/src/api/routes/videos/mod.rs b/crates/bili_sync/src/api/routes/videos/mod.rs index a6b1db5..d0f04c1 100644 --- a/crates/bili_sync/src/api/routes/videos/mod.rs +++ b/crates/bili_sync/src/api/routes/videos/mod.rs @@ -45,7 +45,11 @@ pub async fn get_videos( } } if let Some(query_word) = params.query { - query = query.filter(video::Column::Name.contains(query_word)); + query = query.filter( + video::Column::Name + .contains(&query_word) + .or(video::Column::Bvid.contains(query_word)), + ); } let total_count = query.clone().count(&db).await?; let (page, page_size) = if let (Some(page), Some(page_size)) = (params.page, params.page_size) { diff --git a/web/src/routes/videos/+page.svelte b/web/src/routes/videos/+page.svelte index 5a014e4..b5bc4df 100644 --- a/web/src/routes/videos/+page.svelte +++ b/web/src/routes/videos/+page.svelte @@ -185,7 +185,7 @@
{ setQuery(value);