aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2025-03-12 18:14:04 -0400
committerGitHub <noreply@github.com>2025-03-12 18:14:04 -0400
commitf87150bb3d32b708a886547c28e56fdd38b5115e (patch)
treeb4c73319032ef4b62d6f00e4bc9ff8971b504793 /src
parent237e7bd44b3c9a6f76892be1c6a925bcde64bdbf (diff)
parenta5f3d942f691b914b67b098f7a64406bea569aad (diff)
Merge pull request #9560 from IDisposable/sort-nfo-data
Sort embedded collections in Nfo files
Diffstat (limited to 'src')
-rw-r--r--src/Jellyfin.Extensions/StringExtensions.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Jellyfin.Extensions/StringExtensions.cs b/src/Jellyfin.Extensions/StringExtensions.cs
index 4b9677d9f..715cbf220 100644
--- a/src/Jellyfin.Extensions/StringExtensions.cs
+++ b/src/Jellyfin.Extensions/StringExtensions.cs
@@ -1,4 +1,6 @@
using System;
+using System.Collections.Generic;
+using System.Linq;
using System.Text.RegularExpressions;
using ICU4N.Text;
@@ -123,5 +125,15 @@ namespace Jellyfin.Extensions
{
return (_transliterator.Value is null) ? text : _transliterator.Value.Transliterate(text);
}
+
+ /// <summary>
+ /// Ensures all strings are non-null and trimmed of leading an trailing blanks.
+ /// </summary>
+ /// <param name="values">The enumerable of strings to trim.</param>
+ /// <returns>The enumeration of trimmed strings.</returns>
+ public static IEnumerable<string> Trimmed(this IEnumerable<string> values)
+ {
+ return values.Select(i => (i ?? string.Empty).Trim());
+ }
}
}