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.
This commit is contained in:
Claudio Ortolina
2025-10-24 09:12:21 +01:00
parent f88c3b1d64
commit b2d7c724e4
2 changed files with 4 additions and 22 deletions
@@ -8,13 +8,11 @@ defmodule MusicLibraryWeb.WishlistLive.Show do
release_summary: 1, release_summary: 1,
artist_links: 1, artist_links: 1,
record_colors: 1, record_colors: 1,
record_cover: 1, record_cover: 1
similar_records: 1
] ]
alias MusicLibrary.OnlineStoreTemplates alias MusicLibrary.OnlineStoreTemplates
alias MusicLibrary.Records alias MusicLibrary.Records
alias MusicLibrary.Records.Similarity
@impl true @impl true
def mount(%{"id" => record_id}, _session, socket) do def mount(%{"id" => record_id}, _session, socket) do
@@ -39,8 +37,7 @@ defmodule MusicLibraryWeb.WishlistLive.Show do
socket socket
|> assign(:page_title, page_title(socket.assigns.live_action, record)) |> assign(:page_title, page_title(socket.assigns.live_action, record))
|> assign(:record, record) |> assign(:record, record)
|> assign(:online_store_templates, online_store_templates) |> assign(:online_store_templates, online_store_templates)}
|> assign_similar_records()}
end end
@impl true @impl true
@@ -150,8 +147,7 @@ defmodule MusicLibraryWeb.WishlistLive.Show do
def handle_info({MusicLibraryWeb.Components.RecordForm, {:saved, record}}, socket) do def handle_info({MusicLibraryWeb.Components.RecordForm, {:saved, record}}, socket) do
{:noreply, {:noreply,
socket socket
|> assign(:record, record) |> assign(:record, record)}
|> assign_similar_records()}
end end
@impl true @impl true
@@ -159,8 +155,7 @@ defmodule MusicLibraryWeb.WishlistLive.Show do
{:noreply, {:noreply,
socket socket
|> put_toast(:info, gettext("Record updated in the background")) |> put_toast(:info, gettext("Record updated in the background"))
|> assign(:record, record) |> assign(:record, record)}
|> assign_similar_records()}
end end
def page_title(action, record) do 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(:show), do: gettext("Show")
defp title_segment(:edit), do: gettext("Edit") 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 end
@@ -304,12 +304,6 @@
</details> </details>
</div> </div>
<.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} /> <.json_viewer title={gettext("MusicBrainz data")} data={@record.musicbrainz_data} />
<.structured_modal <.structured_modal