From b2d7c724e40dace9db1af78e823da6789cb66533 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Fri, 24 Oct 2025 09:12:21 +0100 Subject: [PATCH] Remove similar records from wishlist detail page Doesn't provide anything useful as the wishlist pool is quite small - we keep all data/domain functions as it doesn't hurt and there might be other use cases. --- .../live/wishlist_live/show.ex | 20 ++++--------------- .../live/wishlist_live/show.html.heex | 6 ------ 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/lib/music_library_web/live/wishlist_live/show.ex b/lib/music_library_web/live/wishlist_live/show.ex index 4e57509f..708e09b5 100644 --- a/lib/music_library_web/live/wishlist_live/show.ex +++ b/lib/music_library_web/live/wishlist_live/show.ex @@ -8,13 +8,11 @@ defmodule MusicLibraryWeb.WishlistLive.Show do release_summary: 1, artist_links: 1, record_colors: 1, - record_cover: 1, - similar_records: 1 + record_cover: 1 ] alias MusicLibrary.OnlineStoreTemplates alias MusicLibrary.Records - alias MusicLibrary.Records.Similarity @impl true def mount(%{"id" => record_id}, _session, socket) do @@ -39,8 +37,7 @@ defmodule MusicLibraryWeb.WishlistLive.Show do socket |> assign(:page_title, page_title(socket.assigns.live_action, record)) |> assign(:record, record) - |> assign(:online_store_templates, online_store_templates) - |> assign_similar_records()} + |> assign(:online_store_templates, online_store_templates)} end @impl true @@ -150,8 +147,7 @@ defmodule MusicLibraryWeb.WishlistLive.Show do def handle_info({MusicLibraryWeb.Components.RecordForm, {:saved, record}}, socket) do {:noreply, socket - |> assign(:record, record) - |> assign_similar_records()} + |> assign(:record, record)} end @impl true @@ -159,8 +155,7 @@ defmodule MusicLibraryWeb.WishlistLive.Show do {:noreply, socket |> put_toast(:info, gettext("Record updated in the background")) - |> assign(:record, record) - |> assign_similar_records()} + |> assign(:record, record)} end def page_title(action, record) do @@ -180,11 +175,4 @@ defmodule MusicLibraryWeb.WishlistLive.Show do defp title_segment(:show), do: gettext("Show") defp title_segment(:edit), do: gettext("Edit") - - defp assign_similar_records(socket) do - similar_records = - Similarity.find_similar(socket.assigns.record.id, limit: 6, scope: :wishlist) - - assign(socket, :similar_records, similar_records) - end end diff --git a/lib/music_library_web/live/wishlist_live/show.html.heex b/lib/music_library_web/live/wishlist_live/show.html.heex index 0852833d..d741d5b6 100644 --- a/lib/music_library_web/live/wishlist_live/show.html.heex +++ b/lib/music_library_web/live/wishlist_live/show.html.heex @@ -304,12 +304,6 @@ - <.similar_records - similar_records={@similar_records} - record_show_path={fn record -> ~p"/wishlist/#{record}" end} - section={:wishlist} - /> - <.json_viewer title={gettext("MusicBrainz data")} data={@record.musicbrainz_data} /> <.structured_modal