diff --git a/scanner/itunes_scanner.go b/scanner/itunes_scanner.go index c15d14791..ba507e3f3 100644 --- a/scanner/itunes_scanner.go +++ b/scanner/itunes_scanner.go @@ -16,13 +16,12 @@ func (s *ItunesScanner) LoadFolder(path string) []Track { mediaFiles := make([]Track, len(l.Tracks)) i := 0 for id, t := range l.Tracks { - // TODO Decode XML entities (&) if t.Location != "" && strings.Contains(t.Kind, "audio") { mediaFiles[i].Id = id - mediaFiles[i].Album = t.Album - mediaFiles[i].Title = t.Name - mediaFiles[i].Artist = t.Artist - mediaFiles[i].AlbumArtist = t.AlbumArtist + mediaFiles[i].Album = unescape(t.Album) + mediaFiles[i].Title = unescape(t.Name) + mediaFiles[i].Artist = unescape(t.Artist) + mediaFiles[i].AlbumArtist = unescape(t.AlbumArtist) mediaFiles[i].Compilation = t.Compilation mediaFiles[i].Year = t.Year path, _ = url.QueryUnescape(t.Location) @@ -35,4 +34,9 @@ func (s *ItunesScanner) LoadFolder(path string) []Track { return mediaFiles[0:i] } +func unescape(s string) string { + s,_ = url.QueryUnescape(s) + return strings.Replace(s, "&", "&", -1) +} + var _ Scanner = (*ItunesScanner)(nil) \ No newline at end of file