Clean names before calling agents

This commit is contained in:
Deluan
2021-02-08 12:06:15 -05:00
committed by Deluan Quintão
parent a76a52e99a
commit 6c1fc5f836
2 changed files with 35 additions and 26 deletions
-11
View File
@@ -108,17 +108,6 @@ func (e *externalInfo) getArtist(ctx context.Context, id string) (*model.Artist,
return nil, model.ErrNotFound
}
// 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")