From 51a0ef167c9c0b38abdb72a47aee2d2745c81c35 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Mon, 13 May 2024 01:14:05 +0400 Subject: [PATCH] Do not log songs whose artist and title tags are empty. --- internal/http/dj_handlers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/http/dj_handlers.go b/internal/http/dj_handlers.go index bc731cd..4ecc2b5 100644 --- a/internal/http/dj_handlers.go +++ b/internal/http/dj_handlers.go @@ -109,7 +109,8 @@ func (dj *DJHandlers) PlaylistNext(w http.ResponseWriter, _ *http.Request) { dj.curSong.Listeners, dj.curSong.PeakListeners = dj.listeners.Reset() - if dj.curSong.Artist != "" { + if dj.curSong.Artist != "" && !strings.Contains(dj.curSong.Artist, "no artist tag") && + !strings.Contains(dj.curSong.Artist, "No title tag") { if err := dj.stats.Add(dj.curSong); err != nil { log.Println("cannot add a song to a stats DB:", err) }