From 715506352cb468d8459d627e4eeef3cc3b0e66fe Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sun, 26 Dec 2021 19:00:47 -0500 Subject: [PATCH] Filter images and home pages to images with thumbnails --- lib/philomena_web/controllers/activity_controller.ex | 2 +- lib/philomena_web/controllers/image_controller.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/philomena_web/controllers/activity_controller.ex b/lib/philomena_web/controllers/activity_controller.ex index f0b8f013..252d31c2 100644 --- a/lib/philomena_web/controllers/activity_controller.ex +++ b/lib/philomena_web/controllers/activity_controller.ex @@ -23,7 +23,7 @@ defmodule PhilomenaWeb.ActivityController do {:ok, {images, _tags}} = ImageLoader.search_string( conn, - "created_at.lte:3 minutes ago", + "created_at.lte:3 minutes ago, thumbnails_generated:true", pagination: %{conn.assigns.image_pagination | page_number: 1} ) diff --git a/lib/philomena_web/controllers/image_controller.ex b/lib/philomena_web/controllers/image_controller.ex index 4d293421..385047bf 100644 --- a/lib/philomena_web/controllers/image_controller.ex +++ b/lib/philomena_web/controllers/image_controller.ex @@ -36,7 +36,7 @@ defmodule PhilomenaWeb.ImageController do plug PhilomenaWeb.AdvertPlug when action in [:show] def index(conn, _params) do - {:ok, {images, _tags}} = ImageLoader.search_string(conn, "created_at.lte:3 minutes ago") + {:ok, {images, _tags}} = ImageLoader.search_string(conn, "created_at.lte:3 minutes ago, thumbnails_generated:true") images = Elasticsearch.search_records(images, preload(Image, tags: :aliases))