2012-08-18 08:22:54 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using MediaBrowser.Model.Entities;
|
2012-08-29 12:21:56 +00:00
|
|
|
|
using ProtoBuf;
|
2012-08-18 08:22:54 +00:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Model.DTO
|
|
|
|
|
{
|
2012-08-18 16:27:34 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// This is strictly used as a data transfer object from the api layer.
|
|
|
|
|
/// This holds information about a BaseItem in a format that is convenient for the client.
|
|
|
|
|
/// </summary>
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoContract]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public class DTOBaseItem : IHasProviderIds
|
|
|
|
|
{
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(1)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public string Name { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(2)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public Guid Id { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(3)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public DateTime DateCreated { get; set; }
|
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(4)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public string SortName { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(5)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public DateTime? PremiereDate { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(6)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public string Path { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(7)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public string OfficialRating { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(8)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public string Overview { get; set; }
|
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(9)]
|
|
|
|
|
public IList<string> Taglines { get; set; }
|
|
|
|
|
|
|
|
|
|
[ProtoMember(10)]
|
|
|
|
|
public IList<string> Genres { get; set; }
|
2012-08-18 08:22:54 +00:00
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(11)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public string DisplayMediaType { get; set; }
|
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(12)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public float? UserRating { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(13)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public long? RunTimeTicks { get; set; }
|
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(14)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public string AspectRatio { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(15)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public int? ProductionYear { get; set; }
|
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(16)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public int? IndexNumber { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(17)]
|
2012-08-20 02:05:55 +00:00
|
|
|
|
public int? ParentIndexNumber { get; set; }
|
2012-08-18 08:22:54 +00:00
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(18)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public string TrailerUrl { get; set; }
|
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(19)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public Dictionary<string, string> ProviderIds { get; set; }
|
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(20)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public bool HasBanner { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(21)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public bool HasArt { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(22)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public bool HasLogo { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(23)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public bool HasThumb { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(24)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public bool HasPrimaryImage { get; set; }
|
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(25)]
|
2012-08-20 02:05:55 +00:00
|
|
|
|
public string Language { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(26)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public int BackdropCount { get; set; }
|
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(27)]
|
|
|
|
|
public DTOBaseItem[] Children { get; set; }
|
2012-08-18 08:22:54 +00:00
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(28)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public bool IsFolder { get; set; }
|
|
|
|
|
|
2012-08-18 16:45:11 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// If the item is a Folder this will determine if it's the Root or not
|
|
|
|
|
/// </summary>
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(29)]
|
2012-08-18 16:45:11 +00:00
|
|
|
|
public bool? IsRoot { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// If the item is a Folder this will determine if it's a VF or not
|
|
|
|
|
/// </summary>
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(30)]
|
2012-08-18 16:45:11 +00:00
|
|
|
|
public bool? IsVirtualFolder { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(31)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public Guid? ParentId { get; set; }
|
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(32)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public string Type { get; set; }
|
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(33)]
|
|
|
|
|
public BaseItemPerson[] People { get; set; }
|
|
|
|
|
|
|
|
|
|
[ProtoMember(34)]
|
|
|
|
|
public BaseItemStudio[] Studios { get; set; }
|
2012-08-18 08:22:54 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// If the item does not have a logo, this will hold the Id of the Parent that has one.
|
|
|
|
|
/// </summary>
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(35)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public Guid? ParentLogoItemId { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// If the item does not have any backdrops, this will hold the Id of the Parent that has one.
|
|
|
|
|
/// </summary>
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(36)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public Guid? ParentBackdropItemId { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(37)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public int? ParentBackdropCount { get; set; }
|
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(38)]
|
|
|
|
|
public DTOBaseItem[] LocalTrailers { get; set; }
|
|
|
|
|
|
|
|
|
|
[ProtoMember(39)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public int LocalTrailerCount { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// User data for this item based on the user it's being requested for
|
|
|
|
|
/// </summary>
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(40)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public UserItemData UserData { get; set; }
|
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(41)]
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public ItemSpecialCounts SpecialCounts { get; set; }
|
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(42)]
|
2012-08-20 12:09:42 +00:00
|
|
|
|
public AudioInfo AudioInfo { get; set; }
|
2012-08-29 12:21:56 +00:00
|
|
|
|
|
|
|
|
|
[ProtoMember(43)]
|
2012-08-22 12:56:44 +00:00
|
|
|
|
public VideoInfo VideoInfo { get; set; }
|
|
|
|
|
|
2012-08-18 08:22:54 +00:00
|
|
|
|
public bool IsType(Type type)
|
|
|
|
|
{
|
|
|
|
|
return IsType(type.Name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsType(string type)
|
|
|
|
|
{
|
|
|
|
|
return Type.Equals(type, StringComparison.OrdinalIgnoreCase);
|
|
|
|
|
}
|
2012-08-19 17:00:52 +00:00
|
|
|
|
|
2012-08-29 12:21:56 +00:00
|
|
|
|
[ProtoMember(44)]
|
2012-08-19 17:02:26 +00:00
|
|
|
|
public bool IsNew { get; set; }
|
2012-08-18 08:22:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|