diff --git a/lib/philomena_web/controllers/api/json/search/image_controller.ex b/lib/philomena_web/controllers/api/json/search/image_controller.ex index 574569b9..5998ff87 100644 --- a/lib/philomena_web/controllers/api/json/search/image_controller.ex +++ b/lib/philomena_web/controllers/api/json/search/image_controller.ex @@ -2,7 +2,7 @@ defmodule PhilomenaWeb.Api.Json.Search.ImageController do use PhilomenaWeb, :controller alias PhilomenaWeb.ImageLoader - alias Philomena.ImageSorter + alias PhilomenaWeb.ImageSorter alias Philomena.Interactions alias Philomena.Images.Image import Ecto.Query diff --git a/lib/philomena_web/controllers/gallery_controller.ex b/lib/philomena_web/controllers/gallery_controller.ex index 52e40d32..a9e66ace 100644 --- a/lib/philomena_web/controllers/gallery_controller.ex +++ b/lib/philomena_web/controllers/gallery_controller.ex @@ -3,8 +3,8 @@ defmodule PhilomenaWeb.GalleryController do alias PhilomenaWeb.ImageLoader alias PhilomenaWeb.NotificationCountPlug + alias PhilomenaWeb.ImageSorter alias Philomena.Elasticsearch - alias Philomena.ImageSorter alias Philomena.Interactions alias Philomena.Galleries.Gallery alias Philomena.Galleries diff --git a/lib/philomena_web/controllers/image/navigate_controller.ex b/lib/philomena_web/controllers/image/navigate_controller.ex index 1e41466f..cd2c55d2 100644 --- a/lib/philomena_web/controllers/image/navigate_controller.ex +++ b/lib/philomena_web/controllers/image/navigate_controller.ex @@ -2,9 +2,10 @@ defmodule PhilomenaWeb.Image.NavigateController do use PhilomenaWeb, :controller alias PhilomenaWeb.ImageLoader + alias PhilomenaWeb.ImageNavigator + alias PhilomenaWeb.ImageScope alias Philomena.Images.Image alias Philomena.Images.Query - alias Philomena.ImageNavigator plug PhilomenaWeb.CanaryMapPlug, index: :show plug :load_and_authorize_resource, model: Image, id_name: "image_id", persisted: true @@ -15,7 +16,7 @@ defmodule PhilomenaWeb.Image.NavigateController do rel = String.to_existing_atom(rel) next_image = ImageNavigator.find_consecutive(image, rel, params, compile_query(conn), filter) - scope = Philomena.ImageScope.scope(conn) + scope = ImageScope.scope(conn) conn |> redirect(to: Routes.image_path(conn, :show, next_image, scope)) diff --git a/lib/philomena_web/controllers/image/random_controller.ex b/lib/philomena_web/controllers/image/random_controller.ex index 31a062a2..d0cac233 100644 --- a/lib/philomena_web/controllers/image/random_controller.ex +++ b/lib/philomena_web/controllers/image/random_controller.ex @@ -1,16 +1,17 @@ defmodule PhilomenaWeb.Image.RandomController do use PhilomenaWeb, :controller + alias PhilomenaWeb.ImageSorter + alias PhilomenaWeb.ImageScope alias Philomena.Elasticsearch alias Philomena.Images.Query alias Philomena.Images.Image - alias Philomena.ImageSorter def index(conn, params) do user = conn.assigns.current_user filter = conn.assigns.compiled_filter - scope = Philomena.ImageScope.scope(conn) + scope = ImageScope.scope(conn) query = query(user, params) random_id = random_image_id(query, filter) diff --git a/lib/philomena_web/controllers/search_controller.ex b/lib/philomena_web/controllers/search_controller.ex index 1b23ca1e..b2fdf2c7 100644 --- a/lib/philomena_web/controllers/search_controller.ex +++ b/lib/philomena_web/controllers/search_controller.ex @@ -2,7 +2,7 @@ defmodule PhilomenaWeb.SearchController do use PhilomenaWeb, :controller alias PhilomenaWeb.ImageLoader - alias Philomena.ImageSorter + alias PhilomenaWeb.ImageSorter alias Philomena.Interactions def index(conn, params) do diff --git a/lib/philomena/image_navigator.ex b/lib/philomena_web/image_navigator.ex similarity index 98% rename from lib/philomena/image_navigator.ex rename to lib/philomena_web/image_navigator.ex index 6397d5fa..6f4f991d 100644 --- a/lib/philomena/image_navigator.ex +++ b/lib/philomena_web/image_navigator.ex @@ -1,5 +1,5 @@ -defmodule Philomena.ImageNavigator do - alias Philomena.ImageSorter +defmodule PhilomenaWeb.ImageNavigator do + alias PhilomenaWeb.ImageSorter alias Philomena.Images.{Image, ElasticsearchIndex} alias Philomena.Elasticsearch alias Philomena.Repo diff --git a/lib/philomena/image_scope.ex b/lib/philomena_web/image_scope.ex similarity index 90% rename from lib/philomena/image_scope.ex rename to lib/philomena_web/image_scope.ex index b8765486..3c1c48ed 100644 --- a/lib/philomena/image_scope.ex +++ b/lib/philomena_web/image_scope.ex @@ -1,4 +1,4 @@ -defmodule Philomena.ImageScope do +defmodule PhilomenaWeb.ImageScope do def scope(conn) do [] |> scope(conn, "q", :q) diff --git a/lib/philomena/image_sorter.ex b/lib/philomena_web/image_sorter.ex similarity index 98% rename from lib/philomena/image_sorter.ex rename to lib/philomena_web/image_sorter.ex index 004d723d..32a307e3 100644 --- a/lib/philomena/image_sorter.ex +++ b/lib/philomena_web/image_sorter.ex @@ -1,4 +1,4 @@ -defmodule Philomena.ImageSorter do +defmodule PhilomenaWeb.ImageSorter do @allowed_fields ~W( created_at updated_at diff --git a/lib/philomena_web/views/gallery_view.ex b/lib/philomena_web/views/gallery_view.ex index 2f0ae2d0..3796c1ed 100644 --- a/lib/philomena_web/views/gallery_view.ex +++ b/lib/philomena_web/views/gallery_view.ex @@ -1,7 +1,7 @@ defmodule PhilomenaWeb.GalleryView do use PhilomenaWeb, :view - alias Philomena.ImageScope + alias PhilomenaWeb.ImageScope def scope(conn), do: ImageScope.scope(conn) diff --git a/lib/philomena_web/views/image_view.ex b/lib/philomena_web/views/image_view.ex index b17fc686..7b178b47 100644 --- a/lib/philomena_web/views/image_view.ex +++ b/lib/philomena_web/views/image_view.ex @@ -157,7 +157,7 @@ defmodule PhilomenaWeb.ImageView do def username(%{name: name}), do: name def username(_user), do: nil - def scope(conn), do: Philomena.ImageScope.scope(conn) + def scope(conn), do: PhilomenaWeb.ImageScope.scope(conn) def anonymous_by_default?(conn) do conn.assigns.current_user.anonymous_by_default diff --git a/lib/philomena_web/views/search_view.ex b/lib/philomena_web/views/search_view.ex index fe66fbe1..8500d4d8 100644 --- a/lib/philomena_web/views/search_view.ex +++ b/lib/philomena_web/views/search_view.ex @@ -1,6 +1,6 @@ defmodule PhilomenaWeb.SearchView do use PhilomenaWeb, :view - def scope(conn), do: Philomena.ImageScope.scope(conn) + def scope(conn), do: PhilomenaWeb.ImageScope.scope(conn) def hides_images?(conn), do: can?(conn, :hide, %Philomena.Images.Image{}) end