Filter out videos from gallery example

This commit is contained in:
Héctor Ramón Jiménez 2025-10-25 23:11:41 +02:00
parent 44e68aa4b6
commit 42d592d87b
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 13 additions and 2 deletions

View file

@ -38,7 +38,11 @@ impl Image {
.json()
.await?;
Ok(response.items)
Ok(response
.items
.into_iter()
.filter(|image| !image.url.ends_with(".mp4"))
.collect())
}
pub async fn blurhash(

View file

@ -256,7 +256,14 @@ impl Gallery {
self.now,
)
})
.chain((self.images.len()..=Image::LIMIT).map(|_| placeholder()));
.chain(
if self.images.is_empty() {
0..Image::LIMIT
} else {
0..0
}
.map(|_| placeholder()),
);
let gallery = grid(images)
.fluid(Preview::WIDTH)