diff options
| author | Sven Van den brande <sven.vandenbrande@outlook.com> | 2014-11-12 19:21:14 +0100 |
|---|---|---|
| committer | Sven Van den brande <sven.vandenbrande@outlook.com> | 2014-11-12 19:21:14 +0100 |
| commit | b3c0ab869409a743c736a4e9f0cb91260187c7c6 (patch) | |
| tree | 8b90ef0f259ffcb0f4c3b27bb9014e1d89a6ee9a /MediaBrowser.Controller | |
| parent | cbd2c2fc5435aead30513150fc9f50c86eebde49 (diff) | |
| parent | 4f5c7687042148507d5cedfcec81ab355f478f19 (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Conflicts:
MediaBrowser.WebDashboard/dashboard-ui/livetvnewrecording.html
MediaBrowser.WebDashboard/dashboard-ui/livetvseriestimer.html
MediaBrowser.WebDashboard/dashboard-ui/livetvtimer.html
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs index dc9f83b3c9..1f7c62de0b 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs @@ -139,14 +139,14 @@ namespace MediaBrowser.Controller.Entities.Audio { var id = this.GetProviderId(MetadataProviders.MusicBrainzReleaseGroup); - if (!string.IsNullOrEmpty(id)) + if (!string.IsNullOrWhiteSpace(id)) { return "MusicAlbum-MusicBrainzReleaseGroup-" + id; } id = this.GetProviderId(MetadataProviders.MusicBrainzAlbum); - if (!string.IsNullOrEmpty(id)) + if (!string.IsNullOrWhiteSpace(id)) { return "MusicAlbum-Musicbrainz-" + id; } diff --git a/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs b/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs index 5b40073226..d37301b9eb 100644 --- a/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs +++ b/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs @@ -157,18 +157,24 @@ namespace MediaBrowser.Controller.Resolvers // Normalize // Remove whitespace - filename = filename.Replace("-", string.Empty); - filename = filename.Replace(".", string.Empty); - filename = Regex.Replace(filename, @"\s+", ""); + filename = filename.Replace("-", " "); + filename = filename.Replace(".", " "); + filename = filename.Replace("(", " "); + filename = filename.Replace(")", " "); + filename = Regex.Replace(filename, @"\s+", " "); var prefixes = new[] { "disc", "cd", "disk", "vol", "volume" }; + filename = filename.TrimStart(); + foreach (var prefix in prefixes) { if (filename.IndexOf(prefix, StringComparison.OrdinalIgnoreCase) == 0) { var tmp = filename.Substring(prefix.Length); + tmp = tmp.Trim().Split(' ').FirstOrDefault() ?? string.Empty; + int val; if (int.TryParse(tmp, NumberStyles.Any, CultureInfo.InvariantCulture, out val)) { |
