|
|
|
@ -120,7 +120,7 @@ namespace MediaBrowser.Dlna.Didl
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AddCover(item, null, element);
|
|
|
|
|
AddCover(item, context, null, element);
|
|
|
|
|
|
|
|
|
|
return element;
|
|
|
|
|
}
|
|
|
|
@ -481,7 +481,7 @@ namespace MediaBrowser.Dlna.Didl
|
|
|
|
|
|
|
|
|
|
AddCommonFields(folder, stubType, null, container, filter);
|
|
|
|
|
|
|
|
|
|
AddCover(folder, stubType, container);
|
|
|
|
|
AddCover(folder, context, stubType, container);
|
|
|
|
|
|
|
|
|
|
return container;
|
|
|
|
|
}
|
|
|
|
@ -764,7 +764,7 @@ namespace MediaBrowser.Dlna.Didl
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void AddCover(BaseItem item, StubType? stubType, XmlElement element)
|
|
|
|
|
private void AddCover(BaseItem item, BaseItem context, StubType? stubType, XmlElement element)
|
|
|
|
|
{
|
|
|
|
|
if (stubType.HasValue && stubType.Value == StubType.People)
|
|
|
|
|
{
|
|
|
|
@ -772,7 +772,26 @@ namespace MediaBrowser.Dlna.Didl
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var imageInfo = GetImageInfo(item);
|
|
|
|
|
ImageDownloadInfo imageInfo = null;
|
|
|
|
|
|
|
|
|
|
if (context is UserView)
|
|
|
|
|
{
|
|
|
|
|
var episode = item as Episode;
|
|
|
|
|
if (episode != null)
|
|
|
|
|
{
|
|
|
|
|
var parent = (BaseItem)episode.Series ?? episode.Season;
|
|
|
|
|
if (parent != null)
|
|
|
|
|
{
|
|
|
|
|
imageInfo = GetImageInfo(parent);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Finally, just use the image from the item
|
|
|
|
|
if (imageInfo == null)
|
|
|
|
|
{
|
|
|
|
|
imageInfo = GetImageInfo(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (imageInfo == null)
|
|
|
|
|
{
|
|
|
|
@ -850,7 +869,7 @@ namespace MediaBrowser.Dlna.Didl
|
|
|
|
|
private void AddEmbeddedImageAsCover(string name, XmlElement element)
|
|
|
|
|
{
|
|
|
|
|
var result = element.OwnerDocument;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var icon = result.CreateElement("upnp", "albumArtURI", NS_UPNP);
|
|
|
|
|
var profile = result.CreateAttribute("dlna", "profileID", NS_DLNA);
|
|
|
|
|
profile.InnerText = _profile.AlbumArtPn;
|
|
|
|
@ -925,14 +944,11 @@ namespace MediaBrowser.Dlna.Didl
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item is Audio || item is Episode)
|
|
|
|
|
{
|
|
|
|
|
item = item.Parents.FirstOrDefault(i => i.HasImage(ImageType.Primary));
|
|
|
|
|
item = item.Parents.FirstOrDefault(i => i.HasImage(ImageType.Primary));
|
|
|
|
|
|
|
|
|
|
if (item != null)
|
|
|
|
|
{
|
|
|
|
|
return GetImageInfo(item, ImageType.Primary);
|
|
|
|
|
}
|
|
|
|
|
if (item != null)
|
|
|
|
|
{
|
|
|
|
|
return GetImageInfo(item, ImageType.Primary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|