Rename Import -> Add, and avoid surfacing MusicBrainz where unneeded

This commit is contained in:
Claudio Ortolina
2025-03-07 15:10:22 +00:00
parent 27ea8a5b62
commit 91a1141441
9 changed files with 50 additions and 54 deletions
+4 -4
View File
@@ -8,7 +8,7 @@
- [Collection](#collection)
- [Edit a record in the collection](#edit-a-record-in-the-collection)
- [View a record's details in the collection](#view-a-records-details-in-the-collection)
- [Importing a record in the wishlist](#importing-a-record-in-the-wishlist)
- [Adding a record in the wishlist](#importing-a-record-in-the-wishlist)
- [Setup](#setup)
- [Environment configuration](#environment-configuration)
- [Running the application](#running-the-application)
@@ -19,7 +19,7 @@
## Features
- Import records from MusicBrainz, with optional override of specific pieces of data
- Add records from MusicBrainz, with optional override of specific pieces of data
- Manage a collection and a wishlist of records, with ways to quickly search
and filter based on records' metadata
- Integration with Last.fm (display latest scrobbles, and where possible
@@ -46,9 +46,9 @@
![View a record's details in the collection](.github/screenshots/collection-record-details.png)
### Importing a record in the wishlist
### Adding a record in the wishlist
![Importing a record in the wishlist](.github/screenshots/wishlist-import-record.png)
![Adding a record in the wishlist](.github/screenshots/wishlist-import-record.png)
## Setup
@@ -50,10 +50,10 @@ defmodule MusicLibraryWeb.BarcodeScannerComponent do
<div class="mt-4 flex justify-center">
<.button
disabled={length(@scan_results) == 0}
phx-disable-with={gettext("Importing...")}
phx-disable-with={gettext("Adding...")}
phx-click={JS.push("import_releases", target: "#barcode-scanner")}
>
{gettext("Import releases")}
{gettext("Add releases")}
</.button>
</div>
</div>
@@ -24,8 +24,8 @@ defmodule MusicLibraryWeb.ImportComponent do
name={:mb_query}
field={@form[:mb_query]}
type="text"
label={gettext("Search for a record on MusicBrainz")}
prompt={gettext("Search for records")}
label={gettext("Search for a record")}
prompt={gettext("Search for a record")}
phx-debounce="500"
autocorrect="off"
autocapitalize="none"
@@ -41,7 +41,7 @@ defmodule MusicLibraryWeb.CollectionLive.Index do
end
socket
|> assign(:page_title, gettext("Import from MusicBrainz · Collection"))
|> assign(:page_title, gettext("Add new Record · Collection"))
|> assign(:record, nil)
end
@@ -15,7 +15,7 @@
patch={~p"/collection/import"}
>
<.icon name="hero-plus" class="h-4 w-4 mr-2" aria-hidden="true" data-slot="icon" />
{gettext("Import")}
{gettext("Add")}
</.link>
<.link
class={[
@@ -46,7 +46,7 @@ defmodule MusicLibraryWeb.WishlistLive.Index do
end
socket
|> assign(:page_title, gettext("Import from MusicBrainz · Wishlist"))
|> assign(:page_title, gettext("Add new Record · Wishlist"))
|> assign(:record, nil)
end
@@ -14,7 +14,7 @@
patch={~p"/wishlist/import"}
>
<.icon name="hero-plus" class="h-4 w-4 mr-2" aria-hidden="true" data-slot="icon" />
{gettext("Import")}
{gettext("Add")}
</.link>
</div>
</header>
@@ -65,7 +65,7 @@
record={@record}
patch={back_path(@record_list_params)}
initial_query=""
icon_name="hero-star"
icon_name="hero-plus"
/>
</.modal>
+32 -36
View File
@@ -95,12 +95,6 @@ msgstr ""
msgid "Hang in there while we get back on track"
msgstr ""
#: lib/music_library_web/live/collection_live/index.html.heex:18
#: lib/music_library_web/live/wishlist_live/index.html.heex:17
#, elixir-autogen, elixir-format
msgid "Import"
msgstr ""
#: lib/music_library_web/live/collection_live/show.html.heex:231
#: lib/music_library_web/live/wishlist_live/show.html.heex:243
#, elixir-autogen, elixir-format
@@ -213,16 +207,6 @@ msgstr ""
msgid "Search"
msgstr ""
#: lib/music_library_web/components/import_component.ex:27
#, elixir-autogen, elixir-format
msgid "Search for a record on MusicBrainz"
msgstr ""
#: lib/music_library_web/components/import_component.ex:28
#, elixir-autogen, elixir-format
msgid "Search for records"
msgstr ""
#: lib/music_library_web/components/record_components.ex:140
#: lib/music_library_web/live/collection_live/show.ex:140
#: lib/music_library_web/live/wishlist_live/show.ex:143
@@ -400,16 +384,6 @@ msgstr ""
msgid "Details"
msgstr ""
#: lib/music_library_web/live/collection_live/index.ex:44
#, elixir-autogen, elixir-format
msgid "Import from MusicBrainz · Collection"
msgstr ""
#: lib/music_library_web/live/wishlist_live/index.ex:49
#, elixir-autogen, elixir-format
msgid "Import from MusicBrainz · Wishlist"
msgstr ""
#: lib/music_library_web/components/layouts/root.html.heex:59
#, elixir-autogen, elixir-format
msgid "Made by"
@@ -626,21 +600,11 @@ msgstr ""
msgid "Open camera"
msgstr ""
#: lib/music_library_web/components/barcode_scanner_component.ex:56
#, elixir-autogen, elixir-format
msgid "Import releases"
msgstr ""
#: lib/music_library_web/components/barcode_scanner_component.ex:187
#, elixir-autogen, elixir-format
msgid "Failed to search release for barcode %{number}"
msgstr ""
#: lib/music_library_web/components/barcode_scanner_component.ex:53
#, elixir-autogen, elixir-format
msgid "Importing..."
msgstr ""
#: lib/music_library_web/components/barcode_scanner_component.ex:200
#, elixir-autogen, elixir-format
msgid "Records imported successfully"
@@ -695,3 +659,35 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Some records could not be imported: %{summary}"
msgstr ""
#: lib/music_library_web/live/collection_live/index.html.heex:18
#: lib/music_library_web/live/wishlist_live/index.html.heex:17
#, elixir-autogen, elixir-format
msgid "Add"
msgstr ""
#: lib/music_library_web/live/collection_live/index.ex:44
#, elixir-autogen, elixir-format
msgid "Add new Record · Collection"
msgstr ""
#: lib/music_library_web/live/wishlist_live/index.ex:49
#, elixir-autogen, elixir-format
msgid "Add new Record · Wishlist"
msgstr ""
#: lib/music_library_web/components/barcode_scanner_component.ex:56
#, elixir-autogen, elixir-format
msgid "Add releases"
msgstr ""
#: lib/music_library_web/components/barcode_scanner_component.ex:53
#, elixir-autogen, elixir-format
msgid "Adding..."
msgstr ""
#: lib/music_library_web/components/import_component.ex:27
#: lib/music_library_web/components/import_component.ex:28
#, elixir-autogen, elixir-format
msgid "Search for a record"
msgstr ""
@@ -229,12 +229,12 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
end
end
describe "Importing a new record" do
describe "Adding a new record" do
test "it shows the import modal", %{conn: conn} do
conn
|> visit(~p"/collection")
|> click_link("Import")
|> assert_has("label", text: "Search for a record on MusicBrainz")
|> click_link("Add")
|> assert_has("label", text: "Search for a record")
|> assert_has("div", text: "No results")
|> assert_path(~p"/collection/import")
end
@@ -269,7 +269,7 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
session =
conn
|> visit(~p"/collection/import")
|> fill_in("Search for a record on MusicBrainz", with: "Marillion Marbles")
|> fill_in("Search for a record", with: "Marillion Marbles")
for release_group_search_result <- release_group_search_results do
result = ReleaseGroupSearchResult.from_api_response(release_group_search_result)
@@ -386,7 +386,7 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
|> trigger_hook("#barcode-scanner", "barcode_scanned", %{"number" => barcode})
|> assert_has("h2", text: "Marbles")
|> assert_has("span", text: "New")
|> click_button("Import releases")
|> click_button("Add releases")
[record] = MusicLibrary.Repo.all(MusicLibrary.Records.Record)