mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-10-02 00:42:10 +00:00
fix: filter local animation cache sources
This commit is contained in:
@@ -332,7 +332,7 @@ fn kind_of_item(item: &MediaItemPayload) -> CachedMediaKind {
|
|||||||
|
|
||||||
/// A cache entry may replay a remote source URL. Local temp paths disappear
|
/// 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.
|
/// 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://") {
|
if media.starts_with("http://") || media.starts_with("https://") {
|
||||||
media.to_string()
|
media.to_string()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ pub(super) async fn cache_animation_send(
|
|||||||
vec![CachedMedia {
|
vec![CachedMedia {
|
||||||
kind: CachedMediaKind::Animation,
|
kind: CachedMediaKind::Animation,
|
||||||
file_id,
|
file_id,
|
||||||
url: source_url.to_string(),
|
url: super::replayable_cache_url(source_url),
|
||||||
}],
|
}],
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
|
|||||||
Reference in New Issue
Block a user