diff --git a/examples/gallery/src/civitai.rs b/examples/gallery/src/civitai.rs index 4cca8b47..01e6046b 100644 --- a/examples/gallery/src/civitai.rs +++ b/examples/gallery/src/civitai.rs @@ -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( diff --git a/examples/gallery/src/main.rs b/examples/gallery/src/main.rs index 10f1704f..cb37e6a1 100644 --- a/examples/gallery/src/main.rs +++ b/examples/gallery/src/main.rs @@ -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)