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..f222c6c 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] { 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..5c56cfc 100644 --- a/web/src/routes/video-sources/+page.svelte +++ b/web/src/routes/video-sources/+page.svelte @@ -364,9 +364,10 @@ - 名称 + 名称 下载路径 过滤规则 + 最新视频时间 启用状态 操作 @@ -408,6 +409,17 @@ {/if} + + {#if source.latestRowAt} + + {new Date(source.latestRowAt).toLocaleString('zh-CN')} + + {:else} + + - + + {/if} + {#if source.enabled}