Merge pull request #2559 from whooo/295-fix

Add descriptive TV episode titles for DLNA browsing
pull/2758/head
Vasily 5 years ago committed by GitHub
commit a37b69a493
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -435,6 +435,29 @@ namespace Emby.Dlna.Didl
return number + " - " + item.Name; return number + " - " + item.Name;
} }
} }
else if (item is Episode ep)
{
var parent = ep.GetParent();
var name = parent.Name + " - ";
if (ep.ParentIndexNumber.HasValue)
{
name += "S" + ep.ParentIndexNumber.Value.ToString("00", CultureInfo.InvariantCulture);
}
else if (!item.IndexNumber.HasValue)
{
return name + " - " + item.Name;
}
name += "E" + ep.IndexNumber.Value.ToString("00", CultureInfo.InvariantCulture);
if (ep.IndexNumberEnd.HasValue)
{
name += "-" + ep.IndexNumberEnd.Value.ToString("00", CultureInfo.InvariantCulture);
}
name += " - " + item.Name;
return name;
}
return item.Name; return item.Name;
} }

Loading…
Cancel
Save