add: infinitely scrolling timelines

This commit is contained in:
trisua 2025-06-17 01:52:17 -04:00
parent 822aaed0c8
commit 2b253c811c
12 changed files with 316 additions and 9 deletions

View file

@ -12,7 +12,20 @@ pub async fn get_request(
) -> impl IntoResponse {
let data = &(data.read().await).0;
let upload = data.get_upload_by_id(id).await.unwrap();
let upload = match data.get_upload_by_id(id).await {
Ok(u) => u,
Err(_) => {
return Err((
[("Content-Type", "image/svg+xml")],
Body::from(read_image(PathBufD::current().extend(&[
data.0.0.dirs.media.as_str(),
"images",
"default-avatar.svg",
]))),
));
}
};
let path = upload.path(&data.0.0);
if !exists(&path).unwrap() {