fix: 视频合集/视频列表改为全量拉取,确保正确更新 (#290)

This commit is contained in:
ᴀᴍᴛᴏᴀᴇʀ
2025-02-25 20:55:50 +08:00
committed by GitHub
parent a6d0d6b777
commit 33a61ec08d
3 changed files with 15 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ use std::path::Path;
use std::pin::Pin;
use anyhow::Result;
use chrono::Utc;
use enum_dispatch::enum_dispatch;
use futures::Stream;
use sea_orm::DatabaseConnection;
@@ -52,6 +53,11 @@ pub trait VideoSource {
/// Box<dyn ActiveModelTrait> 又提示 ActiveModelTrait 没有 object safety因此手写一个 Enum 静态分发
fn update_latest_row_at(&self, datetime: DateTime) -> _ActiveModel;
// 判断是否应该继续拉取视频
fn should_take(&self, release_datetime: &chrono::DateTime<Utc>, latest_row_at: &chrono::DateTime<Utc>) -> bool {
release_datetime > latest_row_at
}
/// 开始刷新视频
fn log_refresh_video_start(&self);