From bc7f249c20a2afb31b9b333474f8185fd5fc3d5b Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Thu, 24 Sep 2026 19:44:48 +0800 Subject: [PATCH] fix: filter local animation cache sources --- crates/xmedia-bot/src/send/mod.rs | 2 +- crates/xmedia-bot/src/send/post_send.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/xmedia-bot/src/send/mod.rs b/crates/xmedia-bot/src/send/mod.rs index 145324d..904fe49 100644 --- a/crates/xmedia-bot/src/send/mod.rs +++ b/crates/xmedia-bot/src/send/mod.rs @@ -332,7 +332,7 @@ fn kind_of_item(item: &MediaItemPayload) -> CachedMediaKind { /// A cache entry may replay a remote source URL. Local temp paths disappear /// when the task settles and must never be persisted as a source. -fn replayable_cache_url(media: &str) -> String { +pub(super) fn replayable_cache_url(media: &str) -> String { if media.starts_with("http://") || media.starts_with("https://") { media.to_string() } else { diff --git a/crates/xmedia-bot/src/send/post_send.rs b/crates/xmedia-bot/src/send/post_send.rs index 1927448..5c36a02 100644 --- a/crates/xmedia-bot/src/send/post_send.rs +++ b/crates/xmedia-bot/src/send/post_send.rs @@ -50,7 +50,7 @@ pub(super) async fn cache_animation_send( vec![CachedMedia { kind: CachedMediaKind::Animation, file_id, - url: source_url.to_string(), + url: super::replayable_cache_url(source_url), }], ) .await;