Consolidated handlers that return lists of items. Renamed ApiBaseItemWrapper to ApiBaseItemContainer. Added Person and Studio DTO's to BaseItemWrapper

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-08-17 12:47:35 -04:00
parent 5c094afd7e
commit 5c6ec34a9c
25 changed files with 195 additions and 333 deletions

View File

@@ -20,14 +20,14 @@ namespace MediaBrowser.Model.DTO
/// <summary>
/// This is the full return object when requesting an Item
/// </summary>
public class BaseItemWrapper<T>
where T : BaseItem
public class BaseItemContainer<TItemType>
where TItemType : BaseItem
{
public T Item { get; set; }
public TItemType Item { get; set; }
public UserItemData UserItemData { get; set; }
public IEnumerable<BaseItemWrapper<T>> Children { get; set; }
public IEnumerable<BaseItemContainer<TItemType>> Children { get; set; }
public bool IsFolder { get; set; }
@@ -45,7 +45,8 @@ namespace MediaBrowser.Model.DTO
return Type.Equals(type, StringComparison.OrdinalIgnoreCase);
}
public IEnumerable<PersonInfo> People { get; set; }
public IEnumerable<BaseItemPerson> People { get; set; }
public IEnumerable<BaseItemStudio> Studios { get; set; }
/// <summary>
/// If the item does not have a logo, this will hold the Id of the Parent that has one.
@@ -60,7 +61,7 @@ namespace MediaBrowser.Model.DTO
/// <summary>
/// This is strictly for convenience so the UI's don't have to use the verbose generic syntax of BaseItemWrapper<ApiBaseItem>
/// </summary>
public class ApiBaseItemWrapper : BaseItemWrapper<ApiBaseItem>
public class ApiBaseItemContainer : BaseItemContainer<ApiBaseItem>
{
}
}

View File

@@ -1,19 +0,0 @@

namespace MediaBrowser.Model.DTO
{
/// <summary>
/// This is a stub class used by the api to get IBN types along with their item counts
/// </summary>
public class CategoryInfo<T>
{
/// <summary>
/// The actual genre, year, studio, etc
/// </summary>
public T Item { get; set; }
/// <summary>
/// The number of items that have the genre, year, studio, etc
/// </summary>
public int ItemCount { get; set; }
}
}

View File

@@ -0,0 +1,38 @@
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.DTO
{
/// <summary>
/// This is a stub class used by the api to get IBN types along with their item counts
/// </summary>
public class IBNItem<T>
{
/// <summary>
/// The actual genre, year, studio, etc
/// </summary>
public T Item { get; set; }
/// <summary>
/// The number of items that have the genre, year, studio, etc
/// </summary>
public int BaseItemCount { get; set; }
}
/// <summary>
/// This is used by BaseItemContainer
/// </summary>
public class BaseItemPerson
{
public PersonInfo PersonInfo { get; set; }
public string PrimaryImagePath { get; set; }
}
/// <summary>
/// This is used by BaseItemContainer
/// </summary>
public class BaseItemStudio
{
public string Name { get; set; }
public string PrimaryImagePath { get; set; }
}
}