From 744bb536b3027608b8ff6e3564e55f172a3dcf1e 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: Tue, 7 Apr 2026 18:38:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A7=86=E9=A2=91=E6=BA=90=E9=A1=B5?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=9C=80=E6=96=B0=E8=A7=86=E9=A2=91=E6=97=B6?= =?UTF-8?q?=E9=97=B4=20(#700)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/bili_sync/src/api/response.rs | 2 ++ .../bili_sync/src/api/routes/video_sources/mod.rs | 14 ++++++++++---- web/src/lib/types.ts | 1 + web/src/routes/video-sources/+page.svelte | 14 +++++++++++++- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/crates/bili_sync/src/api/response.rs b/crates/bili_sync/src/api/response.rs index b77b83e..ccf748a 100644 --- a/crates/bili_sync/src/api/response.rs +++ b/crates/bili_sync/src/api/response.rs @@ -1,5 +1,6 @@ use bili_sync_entity::rule::Rule; use bili_sync_entity::*; +use sea_orm::prelude::DateTime; use sea_orm::{DerivePartialModel, FromQueryResult}; use serde::Serialize; @@ -218,6 +219,7 @@ pub struct VideoSourceDetail { #[serde(default)] pub use_dynamic_api: Option, pub enabled: bool, + pub latest_row_at: Option, } #[derive(Serialize)] diff --git a/crates/bili_sync/src/api/routes/video_sources/mod.rs b/crates/bili_sync/src/api/routes/video_sources/mod.rs index 182988d..a6e34e7 100644 --- a/crates/bili_sync/src/api/routes/video_sources/mod.rs +++ b/crates/bili_sync/src/api/routes/video_sources/mod.rs @@ -104,7 +104,8 @@ pub async fn get_video_sources_details( collection::Column::Name, collection::Column::Path, collection::Column::Rule, - collection::Column::Enabled + collection::Column::Enabled, + collection::Column::LatestRowAt ]) .into_model::() .all(&db), @@ -115,7 +116,8 @@ pub async fn get_video_sources_details( favorite::Column::Name, favorite::Column::Path, favorite::Column::Rule, - favorite::Column::Enabled + favorite::Column::Enabled, + favorite::Column::LatestRowAt ]) .into_model::() .all(&db), @@ -127,7 +129,8 @@ pub async fn get_video_sources_details( submission::Column::Path, submission::Column::Enabled, submission::Column::Rule, - submission::Column::UseDynamicApi + submission::Column::UseDynamicApi, + submission::Column::LatestRowAt ]) .into_model::() .all(&db), @@ -138,7 +141,8 @@ pub async fn get_video_sources_details( watch_later::Column::Id, watch_later::Column::Path, watch_later::Column::Enabled, - watch_later::Column::Rule + watch_later::Column::Rule, + watch_later::Column::LatestRowAt ]) .into_model::() .all(&db) @@ -152,6 +156,7 @@ pub async fn get_video_sources_details( rule_display: None, use_dynamic_api: None, enabled: false, + latest_row_at: None, }) } for sources in [&mut collections, &mut favorites, &mut submissions, &mut watch_later] { @@ -159,6 +164,7 @@ pub async fn get_video_sources_details( if let Some(rule) = &item.rule { item.rule_display = Some(rule.to_string()); } + item.latest_row_at = item.latest_row_at.filter(|dt| dt.and_utc().timestamp() != 0); }); } Ok(ApiResponse::ok(VideoSourcesDetailsResponse { diff --git a/web/src/lib/types.ts b/web/src/lib/types.ts index 188a89f..ccff298 100644 --- a/web/src/lib/types.ts +++ b/web/src/lib/types.ts @@ -224,6 +224,7 @@ export interface VideoSourceDetail { ruleDisplay: string | null; useDynamicApi: boolean | null; enabled: boolean; + latestRowAt: string | null; } export interface VideoSourcesDetailsResponse { diff --git a/web/src/routes/video-sources/+page.svelte b/web/src/routes/video-sources/+page.svelte index b5fecb8..d234c09 100644 --- a/web/src/routes/video-sources/+page.svelte +++ b/web/src/routes/video-sources/+page.svelte @@ -366,8 +366,9 @@ 名称 下载路径 + 最新视频时间 过滤规则 - 启用状态 + 启用状态 操作 @@ -387,6 +388,17 @@ + + {#if source.latestRowAt} + + {new Date(source.latestRowAt).toLocaleString('zh-CN')} + + {:else} + + - + + {/if} + {#if source.rule && source.rule.length > 0}