[http] Implement setting to ignore StreamUrl

Some radio stations send garbage in the ICY StreamUrl tag, ref issue #1829.
This commit is contained in:
ejurgensen 2025-01-03 10:14:23 +01:00
parent 92ce57b845
commit d18b61406d

View File

@ -293,11 +293,14 @@ metadata_prepare(struct input_source *source)
// Note we map title to album, because clients should show stream name as title // Note we map title to album, because clients should show stream name as title
swap_pointers(&prepared_metadata.parsed.album, &m->title); swap_pointers(&prepared_metadata.parsed.album, &m->title);
// In this case we have to go async to download the url and process the content if (! SETTINGS_GETBOOL("misc", "streamurl_ignore"))
if (m->url && !artwork_extension_is_artwork(m->url)) {
worker_execute(streamurl_cb, m->url, strlen(m->url) + 1, 0); // In this case we have to go async to download the url and process the content
else if (m->url && !artwork_extension_is_artwork(m->url))
swap_pointers(&prepared_metadata.parsed.artwork_url, &m->url); worker_execute(streamurl_cb, m->url, strlen(m->url) + 1, 0);
else
swap_pointers(&prepared_metadata.parsed.artwork_url, &m->url);
}
http_icy_metadata_free(m, 0); http_icy_metadata_free(m, 0);
return 0; return 0;