From 88e2cdd4659266f5b7f03923e1df93b87bae9c16 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Sun, 11 Oct 2020 15:30:18 +0000 Subject: [PATCH] Feature: Added a stats.xml entry to replace , and <artist> --- src/format_mp3.c | 1 + src/format_ogg.c | 1 + src/stats.c | 2 +- web/status.xsl | 7 +------ 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/format_mp3.c b/src/format_mp3.c index fddd23fc..47f3febc 100644 --- a/src/format_mp3.c +++ b/src/format_mp3.c @@ -180,6 +180,7 @@ static void filter_shoutcast_metadata (source_t *source, char *metadata, unsigne memcpy (p, metadata+13, len); logging_playlist (source->mount, p, source->listeners); stats_event_conv (source->mount, "title", p, source->format->charset); + stats_event_conv (source->mount, "display-title", p, source->format->charset); format_set_vorbiscomment(source->format, MP3_METADATA_TITLE, p); yp_touch (source->mount); free (p); diff --git a/src/format_ogg.c b/src/format_ogg.c index 598f5b34..b0d49d52 100644 --- a/src/format_ogg.c +++ b/src/format_ogg.c @@ -319,6 +319,7 @@ static void update_comments(source_t *source) } stats_event (source->mount, "artist", artist); stats_event (source->mount, "title", title); + stats_event (source->mount, "display-title", title); playlist_push_track(source->history, &source->format->vc); diff --git a/src/stats.c b/src/stats.c index e0821956..38a7577c 100644 --- a/src/stats.c +++ b/src/stats.c @@ -855,7 +855,7 @@ static inline int __include_node(unsigned int flags, const char *key, const char static xmlNodePtr _dump_stats_to_doc (xmlNodePtr root, unsigned int flags, const char *show_mount, client_t *client) { static const char *public_keys_global[] = {"admin", "location", "host", "server_id", "server_start_iso8601", NULL}; - static const char *public_keys_source[] = {"listeners", "server_name", "server_description", "stream_start_iso8601", "subtype", "content-type", "listenurl", "genre", NULL}; + static const char *public_keys_source[] = {"listeners", "server_name", "server_description", "stream_start_iso8601", "subtype", "content-type", "listenurl", "genre", "display-title", NULL}; int hidden = flags & STATS_XML_FLAG_SHOW_HIDDEN ? 1 : 0; avl_node *avlnode; xmlNodePtr ret = NULL; diff --git a/web/status.xsl b/web/status.xsl index 65bb2e8a..e01fec89 100644 --- a/web/status.xsl +++ b/web/status.xsl @@ -102,12 +102,7 @@ </xsl:if> <tr> <td>Currently playing:</td> - <td class="streamstats"> - <xsl:if test="artist"> - <xsl:value-of select="artist" /> - - </xsl:if> - <xsl:value-of select="title" /> - </td> + <td class="streamstats"><xsl:value-of select="display-title" /></td> </tr> </tbody> </table>