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

@@ -1,16 +0,0 @@

namespace MediaBrowser.Model.Configuration
{
/// <summary>
/// This holds settings that can be personalized on a per-user, per-device basis.
/// </summary>
public class UserConfiguration
{
public int RecentItemDays { get; set; }
public UserConfiguration()
{
RecentItemDays = 14;
}
}
}

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; }
}
}

View File

@@ -6,7 +6,6 @@ namespace MediaBrowser.Model.Entities
/// </summary>
public class Person : BaseEntity
{
public PersonType PersonType { get; set; }
}
/// <summary>

View File

@@ -32,12 +32,11 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="Configuration\UserConfiguration.cs" />
<Compile Include="DTO\ApiBaseItem.cs" />
<Compile Include="Entities\Audio.cs" />
<Compile Include="Entities\BaseEntity.cs" />
<Compile Include="Entities\BaseItem.cs" />
<Compile Include="DTO\CategoryInfo.cs" />
<Compile Include="DTO\IBNItem.cs" />
<Compile Include="Entities\Folder.cs" />
<Compile Include="Entities\Genre.cs" />
<Compile Include="Entities\ImageType.cs" />

View File

@@ -10,5 +10,12 @@ namespace MediaBrowser.Model.Users
private Dictionary<Guid, UserItemData> _ItemData = new Dictionary<Guid, UserItemData>();
public Dictionary<Guid, UserItemData> ItemData { get { return _ItemData; } set { _ItemData = value; } }
public int RecentItemDays { get; set; }
public User()
{
RecentItemDays = 14;
}
}
}