Update MediaBrowser.Model/Entities/MediaStream.cs

Co-authored-by: Cody Robibero <cody@robibe.ro>
pull/2788/head
Pika 4 years ago committed by GitHub
parent 262daa6650
commit ea4aa5ed8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -153,12 +153,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);

Loading…
Cancel
Save