aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs
diff options
context:
space:
mode:
authorNick <20588554+nicknsy@users.noreply.github.com>2023-10-18 19:27:05 -0700
committerNick <20588554+nicknsy@users.noreply.github.com>2023-10-18 19:27:05 -0700
commitcd662506a1f63f9b20e7f5caa9b671eb3d71ea5a (patch)
treeb58f7158e21e7ed21d77b0f0abfce23d796b3fe3 /MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs
parentc7feea27fde8af60984c8fe41444dc245dbde395 (diff)
parentde08d38a6f2a6e773fa1000574e08322605b56d3 (diff)
Merge branch 'master' into trickplay
Diffstat (limited to 'MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs')
-rw-r--r--MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs b/MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs
index 516eee758..a7c93ac4c 100644
--- a/MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs
+++ b/MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs
@@ -11,10 +11,8 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
/// <summary>
/// Utilities for the TMDb provider.
/// </summary>
- public static class TmdbUtils
+ public static partial class TmdbUtils
{
- private static readonly Regex _nonWords = new(@"[\W_]+", RegexOptions.Compiled);
-
/// <summary>
/// URL of the TMDb instance to use.
/// </summary>
@@ -50,6 +48,9 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
PersonKind.Producer
};
+ [GeneratedRegex(@"[\W_]+")]
+ private static partial Regex NonWordRegex();
+
/// <summary>
/// Cleans the name according to TMDb requirements.
/// </summary>
@@ -58,7 +59,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
public static string CleanName(string name)
{
// TMDb expects a space separated list of words make sure that is the case
- return _nonWords.Replace(name, " ");
+ return NonWordRegex().Replace(name, " ");
}
/// <summary>