π§ Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Replace unicode quotes and dash with simple ascii chars
Deluanc1fb32cedb74
diff --git a/core/external_info.go b/core/external_info.goindex 2bf3b1c9d..87c93c141 100644--- a/core/external_info.go+++ b/core/external_info.go@@ -59,10 +59,23 @@ func (e *externalInfo) getArtist(ctx context.Context, id string) (artist *model.}default:err = model.ErrNotFound+ return}+ artist.Name = clearName(artist.Name)return}+// Replace some Unicode chars with their equivalent ASCII+func clearName(name string) string {+ name = strings.ReplaceAll(name, "β", "-")+ name = strings.ReplaceAll(name, "β", "-")+ name = strings.ReplaceAll(name, "β", `"`)+ name = strings.ReplaceAll(name, "β", `"`)+ name = strings.ReplaceAll(name, "β", `'`)+ name = strings.ReplaceAll(name, "β", `'`)+ return name+}+func (e *externalInfo) SimilarSongs(ctx context.Context, id string, count int) (model.MediaFiles, error) {if e.lfm == nil {log.Warn(ctx, "Last.FM client not configured")@@ -132,6 +145,7 @@ func (e *externalInfo) TopSongs(ctx context.Context, artistName string, count inlog.Error(ctx, "Artist not found", "name", artistName, err)return nil, nil}+ artistName = clearName(artistName)log.Debug(ctx, "Calling Last.FM ArtistGetTopTracks", "artist", artistName, "id", artist.ID)tracks, err := e.lfm.ArtistGetTopTracks(ctx, artistName, count)