fixes for new user settings

This commit is contained in:
Luke Pulverenti
2013-07-08 15:31:45 -04:00
parent 1a0a50c8ab
commit b70ecab40a
6 changed files with 49 additions and 9 deletions

View File

@@ -364,7 +364,7 @@ namespace MediaBrowser.Controller.Dto
// If there is no logo, indicate what parent has one in case the Ui wants to allow inheritance
if (!dto.HasLogo)
{
var parentWithLogo = GetParentLogoItem(item);
var parentWithLogo = GetParentImageItem(item, ImageType.Logo);
if (parentWithLogo != null)
{
@@ -374,6 +374,19 @@ namespace MediaBrowser.Controller.Dto
}
}
// If there is no art, indicate what parent has one in case the Ui wants to allow inheritance
if (!dto.HasArtImage)
{
var parentWithImage = GetParentImageItem(item, ImageType.Art);
if (parentWithImage != null)
{
dto.ParentLogoItemId = GetClientItemId(parentWithImage);
dto.ParentLogoImageTag = GetImageCacheTag(parentWithImage, ImageType.Art, parentWithImage.GetImage(ImageType.Art));
}
}
if (fields.Contains(ItemFields.Path))
{
dto.Path = item.Path;
@@ -751,14 +764,15 @@ namespace MediaBrowser.Controller.Dto
/// If an item does not have a logo, this can be used to find the first parent that does have one
/// </summary>
/// <param name="item">The item.</param>
/// <param name="type">The type.</param>
/// <returns>BaseItem.</returns>
private BaseItem GetParentLogoItem(BaseItem item)
private BaseItem GetParentImageItem(BaseItem item, ImageType type)
{
var parent = item.Parent;
while (parent != null)
{
if (parent.HasImage(ImageType.Logo))
if (parent.HasImage(type))
{
return parent;
}