Fix double escaped lyrics and comments
This commit is contained in:
+2
-5
@@ -9,7 +9,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/kennygrant/sanitize"
|
||||
"github.com/microcosm-cc/bluemonday"
|
||||
"github.com/navidrome/navidrome/conf"
|
||||
"github.com/navidrome/navidrome/consts"
|
||||
"github.com/navidrome/navidrome/model"
|
||||
@@ -19,14 +18,12 @@ import (
|
||||
|
||||
type mediaFileMapper struct {
|
||||
rootFolder string
|
||||
policy *bluemonday.Policy
|
||||
genres model.GenreRepository
|
||||
}
|
||||
|
||||
func newMediaFileMapper(rootFolder string, genres model.GenreRepository) *mediaFileMapper {
|
||||
return &mediaFileMapper{
|
||||
rootFolder: rootFolder,
|
||||
policy: bluemonday.UGCPolicy(),
|
||||
genres: genres,
|
||||
}
|
||||
}
|
||||
@@ -71,8 +68,8 @@ func (s mediaFileMapper) toMediaFile(md metadata.Tags) model.MediaFile {
|
||||
mf.MbzAlbumArtistID = md.MbzAlbumArtistID()
|
||||
mf.MbzAlbumType = md.MbzAlbumType()
|
||||
mf.MbzAlbumComment = md.MbzAlbumComment()
|
||||
mf.Comment = s.policy.Sanitize(md.Comment())
|
||||
mf.Lyrics = s.policy.Sanitize(md.Lyrics())
|
||||
mf.Comment = utils.SanitizeText(md.Comment())
|
||||
mf.Lyrics = utils.SanitizeText(md.Lyrics())
|
||||
mf.Bpm = md.Bpm()
|
||||
mf.CreatedAt = time.Now()
|
||||
mf.UpdatedAt = md.ModificationTime()
|
||||
|
||||
Reference in New Issue
Block a user