Skip to content

Commit 149a7bf

Browse files
author
Datanoise
committed
debug: add deep ID3v2 tracing to fetchTitleAndCache
1 parent 65dfe90 commit 149a7bf

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

playlists/foo.pls

-231 Bytes
Binary file not shown.

relay/streamer.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,23 @@ func (s *Streamer) fetchTitleAndCache(path string) {
218218
title := filepath.Base(path)
219219

220220
// Use id3v2 for extraction (Pure Go, no CGO/iconv)
221-
if tag, err := id3v2.Open(path, id3v2.Options{Parse: true}); err == nil {
221+
logrus.Debugf("fetchTitleAndCache: Opening %s for ID3v2 parsing...", path)
222+
tag, err := id3v2.Open(path, id3v2.Options{Parse: true})
223+
if err != nil {
224+
logrus.WithError(err).Warnf("fetchTitleAndCache: Failed to open %s for id3v2 parsing", path)
225+
} else {
222226
defer tag.Close()
223227
artist := strings.TrimSpace(tag.Artist())
224228
song := strings.TrimSpace(tag.Title())
225229

230+
logrus.Debugf("fetchTitleAndCache: Raw tags for %s: artist=[%s] title=[%s]", path, artist, song)
231+
226232
if artist != "" && song != "" {
227233
title = fmt.Sprintf("%s - %s", artist, song)
228234
} else if song != "" {
229235
title = song
230236
}
237+
logrus.Debugf("fetchTitleAndCache: Final title for %s set to: %s", path, title)
231238
}
232239

233240
s.mu.Lock()

0 commit comments

Comments
 (0)