Add descriptive TV episode titles for DLNA browsing

When browsing TV episodes in Next Up, etc via DLNA a more descriptive
title should be used to easier identify the right episode.
This commit is contained in:
Erik Larsson 2020-03-09 20:02:53 +01:00
parent cc66a40ae3
commit b63ed35238
1 changed files with 23 additions and 0 deletions

View File

@ -436,6 +436,29 @@ namespace Emby.Dlna.Didl
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;
}