From 2df5e7ee1d211149717060f76551273861b05122 Mon Sep 17 00:00:00 2001
From: Claudio Ortolina
Date: Sat, 14 Jun 2025 12:58:47 +0300
Subject: [PATCH] Show wishlisted date for wishlisted records
---
lib/music_library/records.ex | 4 +++-
lib/music_library/records/search_index.ex | 2 ++
.../components/record_components.ex | 15 +++++++++++++++
priv/gettext/default.pot | 5 +++++
priv/gettext/en/LC_MESSAGES/default.po | 5 +++++
5 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/lib/music_library/records.ex b/lib/music_library/records.ex
index 25f9f4f3..f26cb822 100644
--- a/lib/music_library/records.ex
+++ b/lib/music_library/records.ex
@@ -22,7 +22,9 @@ defmodule MusicLibrary.Records do
:release_ids,
:included_release_group_ids,
:cover_hash,
- :release_date
+ :release_date,
+ :inserted_at,
+ :updated_at
]
end
diff --git a/lib/music_library/records/search_index.ex b/lib/music_library/records/search_index.ex
index 857add93..0047621d 100644
--- a/lib/music_library/records/search_index.ex
+++ b/lib/music_library/records/search_index.ex
@@ -28,5 +28,7 @@ defmodule MusicLibrary.Records.SearchIndex do
field :included_release_group_ids, {:array, :string}, default: []
embeds_many :artists, Artist
+
+ timestamps(type: :utc_datetime)
end
end
diff --git a/lib/music_library_web/components/record_components.ex b/lib/music_library_web/components/record_components.ex
index 8b4d2a18..5d09ca77 100644
--- a/lib/music_library_web/components/record_components.ex
+++ b/lib/music_library_web/components/record_components.ex
@@ -91,6 +91,14 @@ defmodule MusicLibraryWeb.RecordComponents do
/>
{Records.Record.format_as_date(record.purchased_at)}
+
+ ยท
+
+ {gettext("Wishlisted on")}
+
+ <.icon name="hero-star" class="-mt-1 h-4 w-4" aria-hidden="true" data-slot="icon" />
+ {Records.Record.format_as_date(record.inserted_at)}
+
@@ -106,6 +114,13 @@ defmodule MusicLibraryWeb.RecordComponents do
<.icon name="hero-banknotes" class="-mt-1 h-4 w-4" aria-hidden="true" data-slot="icon" />
{Records.Record.format_as_date(record.purchased_at)}
+
+
+ {gettext("Wishlisted on")}
+
+ <.icon name="hero-star" class="-mt-1 h-4 w-4" aria-hidden="true" data-slot="icon" />
+ {Records.Record.format_as_date(record.inserted_at)}
+
<%!-- TODO: replace with OSS version --%>
<.actions_menu id={record.id} background_container_target="#records > li">
diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot
index 0c6776d8..7df63b12 100644
--- a/priv/gettext/default.pot
+++ b/priv/gettext/default.pot
@@ -905,3 +905,8 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Last year"
msgstr ""
+
+#: lib/music_library_web/components/record_components.ex
+#, elixir-autogen, elixir-format
+msgid "Wishlisted on"
+msgstr ""
diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po
index 79de3dbe..58862c2e 100644
--- a/priv/gettext/en/LC_MESSAGES/default.po
+++ b/priv/gettext/en/LC_MESSAGES/default.po
@@ -905,3 +905,8 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "Last year"
msgstr ""
+
+#: lib/music_library_web/components/record_components.ex
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Wishlisted on"
+msgstr ""