fix: handle absolute poster URLs from federated instances in templates

This commit is contained in:
2026-05-13 23:32:08 +02:00
parent c420826474
commit 25cd6c9294
5 changed files with 17 additions and 5 deletions

View File

@@ -12,6 +12,18 @@ use domain::models::{
collections::Paginated,
};
mod filters {
#[askama::filter_fn]
pub fn poster_src<T: std::fmt::Display>(path: T, _env: &dyn askama::Values) -> askama::Result<String> {
let p = path.to_string();
if p.starts_with("http://") || p.starts_with("https://") {
Ok(p)
} else {
Ok(format!("/images/{}", p))
}
}
}
struct PageItem {
number: u32,
is_current: bool,