aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-09-05 18:59:07 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-09-05 18:59:07 -0400
commit5c908c1f0525faaa3c1616d7fb35a67f86beece2 (patch)
treecef87d05bee548964e31d3af799b157ddbf5452d
parente22b696d96fc2f6e9502c7b1b136f660e1009184 (diff)
trim audio tag values
-rw-r--r--MediaBrowser.Providers/MediaInfo/FFProbeAudioInfoProvider.cs23
1 files changed, 7 insertions, 16 deletions
diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfoProvider.cs b/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfoProvider.cs
index 3a0640e56..281d7aa36 100644
--- a/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfoProvider.cs
+++ b/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfoProvider.cs
@@ -116,12 +116,7 @@ namespace MediaBrowser.Providers.MediaInfo
{
foreach (var person in Split(composer))
{
- var name = person.Trim();
-
- if (!string.IsNullOrEmpty(name))
- {
- audio.AddPerson(new PersonInfo { Name = name, Type = PersonType.Composer });
- }
+ audio.AddPerson(new PersonInfo { Name = person, Type = PersonType.Composer });
}
}
}
@@ -194,7 +189,8 @@ namespace MediaBrowser.Providers.MediaInfo
var delimeter = _nameDelimiters.Any(i => val.IndexOf(i) != -1) ? _nameDelimiters : new[] { ',' };
return val.Split(delimeter, StringSplitOptions.RemoveEmptyEntries)
- .Where(i => !string.IsNullOrWhiteSpace(i));
+ .Where(i => !string.IsNullOrWhiteSpace(i))
+ .Select(i => i.Trim());
}
/// <summary>
@@ -210,14 +206,11 @@ namespace MediaBrowser.Providers.MediaInfo
if (!string.IsNullOrEmpty(val))
{
// Sometimes the artist name is listed here, account for that
- var studios =
- Split(val)
- .Where(i => !audio.HasArtist(i));
+ var studios = Split(val).Where(i => !audio.HasArtist(i));
foreach (var studio in studios)
{
- // Account for sloppy tags by trimming
- audio.AddStudio(studio.Trim());
+ audio.AddStudio(studio);
}
}
}
@@ -235,11 +228,9 @@ namespace MediaBrowser.Providers.MediaInfo
{
audio.Genres.Clear();
- foreach (var genre in Split(val)
- .Where(i => !string.IsNullOrWhiteSpace(i)))
+ foreach (var genre in Split(val))
{
- // Account for sloppy tags by trimming
- audio.AddGenre(genre.Trim());
+ audio.AddGenre(genre);
}
}
}