diff --git a/lib/music_library/online_store_templates.ex b/lib/music_library/online_store_templates.ex
index 2fdc0d10..9feab061 100644
--- a/lib/music_library/online_store_templates.ex
+++ b/lib/music_library/online_store_templates.ex
@@ -68,9 +68,11 @@ defmodule MusicLibrary.OnlineStoreTemplates do
"""
def generate_url(template, record) do
artists_string = Enum.map_join(record.artists, " ", & &1.name)
+ format_string = Atom.to_string(record.format)
template.url_template
|> String.replace("{artist}", URI.encode(artists_string))
|> String.replace("{title}", URI.encode(record.title))
+ |> String.replace("{format}", URI.encode(format_string))
end
end
diff --git a/lib/music_library_web/live/online_store_template_live/form_component.ex b/lib/music_library_web/live/online_store_template_live/form_component.ex
index c62a72be..e42f5cec 100644
--- a/lib/music_library_web/live/online_store_template_live/form_component.ex
+++ b/lib/music_library_web/live/online_store_template_live/form_component.ex
@@ -59,6 +59,10 @@ defmodule MusicLibraryWeb.OnlineStoreTemplateLive.FormComponent do
{"{title}"}
- {gettext("Record title")}
+ {"{format}"}
+ - {gettext("Record format")}
+