From 3cfcaedede68d3e84a1ada02d7a808af5832ff91 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Wed, 24 Sep 2025 16:19:00 +0300 Subject: [PATCH] Fix display of disc count in release --- lib/music_library_web/live/scrobble_live/index.ex | 2 +- lib/music_library_web/live/scrobble_live/index.html.heex | 4 +--- priv/gettext/default.pot | 7 +++++++ priv/gettext/en/LC_MESSAGES/default.po | 7 +++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/music_library_web/live/scrobble_live/index.ex b/lib/music_library_web/live/scrobble_live/index.ex index 4deb6e9c..f0d4313f 100644 --- a/lib/music_library_web/live/scrobble_live/index.ex +++ b/lib/music_library_web/live/scrobble_live/index.ex @@ -3,7 +3,7 @@ defmodule MusicLibraryWeb.ScrobbleLive.Index do import MusicLibraryWeb.RecordComponents, only: [type_label: 1] - alias MusicBrainz.ReleaseGroupSearchResult + alias MusicBrainz.{Release, ReleaseGroupSearchResult} alias MusicLibrary.Records alias MusicLibrary.ScrobbleActivity diff --git a/lib/music_library_web/live/scrobble_live/index.html.heex b/lib/music_library_web/live/scrobble_live/index.html.heex index 0e331ff2..91ce8370 100644 --- a/lib/music_library_web/live/scrobble_live/index.html.heex +++ b/lib/music_library_web/live/scrobble_live/index.html.heex @@ -93,9 +93,7 @@ <% end %> <%= if release.media != [] do %>

- {length(release.media)} medium(s) • {release.media - |> Enum.map(&length(&1.tracks)) - |> Enum.sum()} tracks + {ngettext("1 disc", "%{count} discs", Release.media_count(release))}

<% end %> diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index d1bf66ac..43ed4608 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -1422,6 +1422,13 @@ msgstr "" msgid "Release Groups" msgstr "" +#: lib/music_library_web/live/scrobble_live/index.html.heex +#, elixir-autogen, elixir-format +msgid "1 disc" +msgid_plural "%{count} discs" +msgstr[0] "" +msgstr[1] "" + #: lib/music_library_web/live/scrobble_live/index.html.heex #, elixir-autogen, elixir-format msgid "Releases for \"%{title}\"" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index 73cd8e5a..b894bd43 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -1422,6 +1422,13 @@ msgstr "" msgid "Release Groups" msgstr "" +#: lib/music_library_web/live/scrobble_live/index.html.heex +#, elixir-autogen, elixir-format +msgid "1 disc" +msgid_plural "%{count} discs" +msgstr[0] "" +msgstr[1] "" + #: lib/music_library_web/live/scrobble_live/index.html.heex #, elixir-autogen, elixir-format msgid "Releases for \"%{title}\""