From c8fc630bed19f61738461373268e929b78588c2a Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Tue, 15 Jul 2025 11:04:53 +0100 Subject: [PATCH] Encode generated template URLs using www_form format --- lib/music_library/online_store_templates.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/music_library/online_store_templates.ex b/lib/music_library/online_store_templates.ex index 9feab061..8df38b96 100644 --- a/lib/music_library/online_store_templates.ex +++ b/lib/music_library/online_store_templates.ex @@ -71,8 +71,8 @@ defmodule MusicLibrary.OnlineStoreTemplates do 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)) + |> String.replace("{artist}", URI.encode_www_form(artists_string)) + |> String.replace("{title}", URI.encode_www_form(record.title)) + |> String.replace("{format}", URI.encode_www_form(format_string)) end end