Sfoglia il codice sorgente

Update MediaBrowser.Model/Entities/MediaStream.cs

Co-authored-by: Cody Robibero <cody@robibe.ro>
Pika 4 anni fa
parent
commit
262daa6650
1 ha cambiato i file con 11 aggiunte e 6 eliminazioni
  1. 11 6
      MediaBrowser.Model/Entities/MediaStream.cs

+ 11 - 6
MediaBrowser.Model/Entities/MediaStream.cs

@@ -182,12 +182,17 @@ namespace MediaBrowser.Model.Entities
 
                         if (!string.IsNullOrEmpty(Title))
                         {
-                            return attributes.AsEnumerable()
-                                // keep Tags that are not already in Title
-                                .Where(tag => Title.IndexOf(tag, StringComparison.OrdinalIgnoreCase) == -1)
-                                // attributes concatenation, starting with Title
-                                .Aggregate(new StringBuilder(Title), (builder, attr) => builder.Append(" - ").Append(attr))
-                                .ToString();
+                            var result = new StringBuilder(Title);
+                            foreach (var tag in attributes)
+                            {
+                                // Keep Tags that are not already in Title.
+                                if (Title.IndexOf(tag, StringComparison.OrdinalIgnoreCase) == -1)
+                                {
+                                    result.Append(" - ").Append(tag);
+                                }
+                            }
+
+                            return result.ToString();
                         }
 
                         return string.Join(" ", attributes);