diff options
| author | Anthony Lavado <anthonylavado@users.noreply.github.com> | 2019-09-02 01:33:14 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-02 01:33:14 -0400 |
| commit | 852e5e29ca0060b33c68bd11365a93451750034f (patch) | |
| tree | 1e66975804a42b821299918c6fa67427f84a2505 | |
| parent | 160718efe275e2359aeb499eddba631a961366af (diff) | |
| parent | 907b3185c288c38a398c2e6498f43bcce18c6ee9 (diff) | |
Merge pull request #1704 from nvllsvm/fix_replace_multiple_spaces
Fix replace multiple spaces
| -rw-r--r-- | MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs b/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs index 1578e4341..10ed4f073 100644 --- a/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs +++ b/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; +using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Common.Net; @@ -312,14 +313,7 @@ namespace MediaBrowser.Providers.TV.TheTVDB } sb.Replace(", the", string.Empty).Replace("the ", " ").Replace(" the ", " "); - int prevLength; - do - { - prevLength = sb.Length; - sb.Replace(" ", " "); - } while (name.Length != prevLength); - - return sb.ToString().Trim(); + return Regex.Replace(sb.ToString().Trim(), @"\s+", " "); } private void MapSeriesToResult(MetadataResult<Series> result, TvDbSharper.Dto.Series tvdbSeries, string metadataLanguage) |
