diff options
| author | ebr11 Eric Reed spam <ebr11 Eric Reed spam@reedsplace.com> | 2012-08-01 23:15:11 -0400 |
|---|---|---|
| committer | ebr11 Eric Reed spam <ebr11 Eric Reed spam@reedsplace.com> | 2012-08-01 23:15:11 -0400 |
| commit | 51ce69d9dbd0f2acf44100de4c021eec2d841d89 (patch) | |
| tree | b256f22f5e426874602d88739bc04daa73356202 /MediaBrowser.Api/ApiService.cs | |
| parent | 6e8bfb6d9b34e8aad876bdb21907ca686741e7cb (diff) | |
| parent | 80fd8d015626cbb5ed9ea8678149b13a4a1272f4 (diff) | |
Merge
Diffstat (limited to 'MediaBrowser.Api/ApiService.cs')
| -rw-r--r-- | MediaBrowser.Api/ApiService.cs | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/MediaBrowser.Api/ApiService.cs b/MediaBrowser.Api/ApiService.cs index 34f7e69e7..bb2427574 100644 --- a/MediaBrowser.Api/ApiService.cs +++ b/MediaBrowser.Api/ApiService.cs @@ -31,9 +31,14 @@ namespace MediaBrowser.Api UserItemData = Kernel.Instance.GetUserItemData(userId, item.Id),
Type = item.GetType().Name,
IsFolder = (item is Folder),
- ParentId = item.Parent == null ? Guid.Empty : item.Parent.Id
+ ParentLogoItemId = GetParentLogoItemId(item)
};
+ if (item.Parent != null)
+ {
+ wrapper.ParentId = item.Parent.Id;
+ }
+
if (includeChildren)
{
var folder = item as Folder;
@@ -46,5 +51,25 @@ namespace MediaBrowser.Api return wrapper;
}
+
+ private static Guid? GetParentLogoItemId(BaseItem item)
+ {
+ if (string.IsNullOrEmpty(item.LogoImagePath))
+ {
+ var parent = item.Parent;
+
+ while (parent != null)
+ {
+ if (!string.IsNullOrEmpty(parent.LogoImagePath))
+ {
+ return parent.Id;
+ }
+
+ parent = parent.Parent;
+ }
+ }
+
+ return null;
+ }
}
}
|
