Remove "Add More" functionality from artist show page
I don't use it, and it takes up space that I want to have for filters
This commit is contained in:
@@ -95,34 +95,6 @@ defmodule MusicLibraryWeb.ArtistLive.Show do
|
|||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def handle_event("import", %{"id" => musicbrainz_id, "format" => format}, socket) do
|
|
||||||
case Records.import_from_musicbrainz_release_group(musicbrainz_id,
|
|
||||||
format: format,
|
|
||||||
purchased_at: nil
|
|
||||||
) do
|
|
||||||
{:ok, _record} ->
|
|
||||||
{:noreply,
|
|
||||||
socket
|
|
||||||
|> put_toast(:info, gettext("Record wishlisted successfully"))
|
|
||||||
|> push_patch(to: ~p"/artists/#{socket.assigns.artist.musicbrainz_id}")}
|
|
||||||
|
|
||||||
{:error, %Ecto.Changeset{} = changeset} ->
|
|
||||||
{:noreply,
|
|
||||||
socket
|
|
||||||
|> put_toast(
|
|
||||||
:error,
|
|
||||||
gettext("Error wishlisting record") <> "," <> inspect(changeset.errors)
|
|
||||||
)
|
|
||||||
|> push_patch(to: ~p"/artists/#{socket.assigns.artist.musicbrainz_id}")}
|
|
||||||
|
|
||||||
{:error, reason} ->
|
|
||||||
{:noreply,
|
|
||||||
socket
|
|
||||||
|> put_toast(:error, gettext("Error wishlisting record") <> "," <> inspect(reason))
|
|
||||||
|> push_patch(to: ~p"/artists/#{socket.assigns.artist.musicbrainz_id}")}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def handle_event("refresh_artist_info", %{"id" => id}, socket) do
|
def handle_event("refresh_artist_info", %{"id" => id}, socket) do
|
||||||
case Artists.fetch_artist_info(id) do
|
case Artists.fetch_artist_info(id) do
|
||||||
{:ok, artist_info} ->
|
{:ok, artist_info} ->
|
||||||
@@ -221,20 +193,6 @@ defmodule MusicLibraryWeb.ArtistLive.Show do
|
|||||||
|> assign(:page_title, page_title(socket.assigns.live_action, artist))
|
|> assign(:page_title, page_title(socket.assigns.live_action, artist))
|
||||||
end
|
end
|
||||||
|
|
||||||
defp apply_action(socket, :import, params) do
|
|
||||||
socket =
|
|
||||||
if get_in(socket.assigns, [:streams, :collection_records]) == nil do
|
|
||||||
socket
|
|
||||||
|> apply_action(:show, params)
|
|
||||||
else
|
|
||||||
socket
|
|
||||||
end
|
|
||||||
|
|
||||||
socket
|
|
||||||
|> assign(:page_title, gettext("Add more · Artist"))
|
|
||||||
|> assign(:initial_query, "arid:#{socket.assigns.artist.musicbrainz_id}")
|
|
||||||
end
|
|
||||||
|
|
||||||
defp apply_action(socket, :edit, params) do
|
defp apply_action(socket, :edit, params) do
|
||||||
socket =
|
socket =
|
||||||
if get_in(socket.assigns, [:streams, :collection_records]) == nil do
|
if get_in(socket.assigns, [:streams, :collection_records]) == nil do
|
||||||
@@ -283,17 +241,6 @@ defmodule MusicLibraryWeb.ArtistLive.Show do
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp page_title(:import, artist) do
|
|
||||||
Enum.join(
|
|
||||||
[
|
|
||||||
artist.name,
|
|
||||||
"·",
|
|
||||||
gettext("Add more")
|
|
||||||
],
|
|
||||||
" "
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
defp group_and_sort(records) do
|
defp group_and_sort(records) do
|
||||||
{collection, wishlist} = Enum.split_with(records, fn r -> r.purchased_at end)
|
{collection, wishlist} = Enum.split_with(records, fn r -> r.purchased_at end)
|
||||||
|
|
||||||
|
|||||||
@@ -99,10 +99,6 @@
|
|||||||
<.on_tour_link lastfm_artist_info={lastfm_artist_info} />
|
<.on_tour_link lastfm_artist_info={lastfm_artist_info} />
|
||||||
<.play_count play_count={lastfm_artist_info.play_count} />
|
<.play_count play_count={lastfm_artist_info.play_count} />
|
||||||
</.async_result>
|
</.async_result>
|
||||||
<.button variant="solid" patch={~p"/artists/#{@artist.musicbrainz_id}/import"}>
|
|
||||||
<.icon name="hero-plus" class="icon" aria-hidden="true" data-slot="icon" />
|
|
||||||
{gettext("Add more")}
|
|
||||||
</.button>
|
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
@@ -265,22 +261,6 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<.structured_modal
|
|
||||||
:if={@live_action == :import}
|
|
||||||
id="record-modal"
|
|
||||||
on_close={JS.patch(~p"/artists/#{@artist.musicbrainz_id}")}
|
|
||||||
>
|
|
||||||
<.live_component
|
|
||||||
module={MusicLibraryWeb.Components.AddRecord}
|
|
||||||
id={:search}
|
|
||||||
title={@page_title}
|
|
||||||
action={@live_action}
|
|
||||||
patch={~p"/artists/#{@artist.musicbrainz_id}"}
|
|
||||||
initial_query={"arid:#{@artist.musicbrainz_id}"}
|
|
||||||
icon_name="hero-plus"
|
|
||||||
/>
|
|
||||||
</.structured_modal>
|
|
||||||
|
|
||||||
<.live_component
|
<.live_component
|
||||||
id="artist-notes"
|
id="artist-notes"
|
||||||
sheet_id="artist-notes-sheet"
|
sheet_id="artist-notes-sheet"
|
||||||
|
|||||||
@@ -632,25 +632,17 @@ msgstr ""
|
|||||||
msgid "Tracks"
|
msgid "Tracks"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/artist_live/show.ex
|
|
||||||
#: lib/music_library_web/live/artist_live/show.html.heex
|
|
||||||
#, elixir-autogen, elixir-format
|
|
||||||
msgid "Add more"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: lib/music_library_web/live/artist_live/show.ex
|
#: lib/music_library_web/live/artist_live/show.ex
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Add more · Artist"
|
msgid "Add more · Artist"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/artist_live/show.ex
|
|
||||||
#: lib/music_library_web/live/stats_live/index.ex
|
#: lib/music_library_web/live/stats_live/index.ex
|
||||||
#: lib/music_library_web/live/wishlist_live/index.ex
|
#: lib/music_library_web/live/wishlist_live/index.ex
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Error wishlisting record"
|
msgid "Error wishlisting record"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/artist_live/show.ex
|
|
||||||
#: lib/music_library_web/live/stats_live/index.ex
|
#: lib/music_library_web/live/stats_live/index.ex
|
||||||
#: lib/music_library_web/live/wishlist_live/index.ex
|
#: lib/music_library_web/live/wishlist_live/index.ex
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
|
|||||||
@@ -632,25 +632,17 @@ msgstr ""
|
|||||||
msgid "Tracks"
|
msgid "Tracks"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/artist_live/show.ex
|
|
||||||
#: lib/music_library_web/live/artist_live/show.html.heex
|
|
||||||
#, elixir-autogen, elixir-format
|
|
||||||
msgid "Add more"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: lib/music_library_web/live/artist_live/show.ex
|
#: lib/music_library_web/live/artist_live/show.ex
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Add more · Artist"
|
msgid "Add more · Artist"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/artist_live/show.ex
|
|
||||||
#: lib/music_library_web/live/stats_live/index.ex
|
#: lib/music_library_web/live/stats_live/index.ex
|
||||||
#: lib/music_library_web/live/wishlist_live/index.ex
|
#: lib/music_library_web/live/wishlist_live/index.ex
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Error wishlisting record"
|
msgid "Error wishlisting record"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/artist_live/show.ex
|
|
||||||
#: lib/music_library_web/live/stats_live/index.ex
|
#: lib/music_library_web/live/stats_live/index.ex
|
||||||
#: lib/music_library_web/live/wishlist_live/index.ex
|
#: lib/music_library_web/live/wishlist_live/index.ex
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
|
|||||||
Reference in New Issue
Block a user