mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-23 02:27:17 +00:00
Upgraded Protobuf, and added api support for it
This commit is contained in:
parent
de74609784
commit
cb7f04e4d3
@@ -1,13 +1,23 @@
|
||||
|
||||
using ProtoBuf;
|
||||
|
||||
namespace MediaBrowser.Model.DTO
|
||||
{
|
||||
[ProtoContract]
|
||||
public class AudioInfo
|
||||
{
|
||||
[ProtoMember(1)]
|
||||
public int BitRate { get; set; }
|
||||
|
||||
[ProtoMember(2)]
|
||||
public int Channels { get; set; }
|
||||
|
||||
[ProtoMember(3)]
|
||||
public string Artist { get; set; }
|
||||
|
||||
[ProtoMember(4)]
|
||||
public string Album { get; set; }
|
||||
|
||||
[ProtoMember(5)]
|
||||
public string AlbumArtist { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using ProtoBuf;
|
||||
|
||||
namespace MediaBrowser.Model.DTO
|
||||
{
|
||||
@@ -8,89 +9,151 @@ namespace MediaBrowser.Model.DTO
|
||||
/// 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>
|
||||
[ProtoContract]
|
||||
public class DTOBaseItem : IHasProviderIds
|
||||
{
|
||||
[ProtoMember(1)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[ProtoMember(2)]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
[ProtoMember(3)]
|
||||
public DateTime DateCreated { get; set; }
|
||||
|
||||
[ProtoMember(4)]
|
||||
public string SortName { get; set; }
|
||||
|
||||
[ProtoMember(5)]
|
||||
public DateTime? PremiereDate { get; set; }
|
||||
|
||||
[ProtoMember(6)]
|
||||
public string Path { get; set; }
|
||||
|
||||
[ProtoMember(7)]
|
||||
public string OfficialRating { get; set; }
|
||||
|
||||
[ProtoMember(8)]
|
||||
public string Overview { get; set; }
|
||||
public IEnumerable<string> Taglines { get; set; }
|
||||
|
||||
public IEnumerable<string> Genres { get; set; }
|
||||
[ProtoMember(9)]
|
||||
public IList<string> Taglines { get; set; }
|
||||
|
||||
[ProtoMember(10)]
|
||||
public IList<string> Genres { get; set; }
|
||||
|
||||
[ProtoMember(11)]
|
||||
public string DisplayMediaType { get; set; }
|
||||
|
||||
[ProtoMember(12)]
|
||||
public float? UserRating { get; set; }
|
||||
|
||||
[ProtoMember(13)]
|
||||
public long? RunTimeTicks { get; set; }
|
||||
|
||||
[ProtoMember(14)]
|
||||
public string AspectRatio { get; set; }
|
||||
|
||||
[ProtoMember(15)]
|
||||
public int? ProductionYear { get; set; }
|
||||
|
||||
[ProtoMember(16)]
|
||||
public int? IndexNumber { get; set; }
|
||||
|
||||
[ProtoMember(17)]
|
||||
public int? ParentIndexNumber { get; set; }
|
||||
|
||||
[ProtoMember(18)]
|
||||
public string TrailerUrl { get; set; }
|
||||
|
||||
[ProtoMember(19)]
|
||||
public Dictionary<string, string> ProviderIds { get; set; }
|
||||
|
||||
[ProtoMember(20)]
|
||||
public bool HasBanner { get; set; }
|
||||
|
||||
[ProtoMember(21)]
|
||||
public bool HasArt { get; set; }
|
||||
|
||||
[ProtoMember(22)]
|
||||
public bool HasLogo { get; set; }
|
||||
|
||||
[ProtoMember(23)]
|
||||
public bool HasThumb { get; set; }
|
||||
|
||||
[ProtoMember(24)]
|
||||
public bool HasPrimaryImage { get; set; }
|
||||
|
||||
[ProtoMember(25)]
|
||||
public string Language { get; set; }
|
||||
|
||||
|
||||
[ProtoMember(26)]
|
||||
public int BackdropCount { get; set; }
|
||||
|
||||
public IEnumerable<DTOBaseItem> Children { get; set; }
|
||||
[ProtoMember(27)]
|
||||
public DTOBaseItem[] Children { get; set; }
|
||||
|
||||
[ProtoMember(28)]
|
||||
public bool IsFolder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If the item is a Folder this will determine if it's the Root or not
|
||||
/// </summary>
|
||||
[ProtoMember(29)]
|
||||
public bool? IsRoot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If the item is a Folder this will determine if it's a VF or not
|
||||
/// </summary>
|
||||
[ProtoMember(30)]
|
||||
public bool? IsVirtualFolder { get; set; }
|
||||
|
||||
|
||||
[ProtoMember(31)]
|
||||
public Guid? ParentId { get; set; }
|
||||
|
||||
[ProtoMember(32)]
|
||||
public string Type { get; set; }
|
||||
|
||||
public IEnumerable<BaseItemPerson> People { get; set; }
|
||||
public IEnumerable<BaseItemStudio> Studios { get; set; }
|
||||
[ProtoMember(33)]
|
||||
public BaseItemPerson[] People { get; set; }
|
||||
|
||||
[ProtoMember(34)]
|
||||
public BaseItemStudio[] Studios { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If the item does not have a logo, this will hold the Id of the Parent that has one.
|
||||
/// </summary>
|
||||
[ProtoMember(35)]
|
||||
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>
|
||||
[ProtoMember(36)]
|
||||
public Guid? ParentBackdropItemId { get; set; }
|
||||
|
||||
[ProtoMember(37)]
|
||||
public int? ParentBackdropCount { get; set; }
|
||||
|
||||
public IEnumerable<DTOBaseItem> LocalTrailers { get; set; }
|
||||
[ProtoMember(38)]
|
||||
public DTOBaseItem[] LocalTrailers { get; set; }
|
||||
|
||||
[ProtoMember(39)]
|
||||
public int LocalTrailerCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User data for this item based on the user it's being requested for
|
||||
/// </summary>
|
||||
[ProtoMember(40)]
|
||||
public UserItemData UserData { get; set; }
|
||||
|
||||
[ProtoMember(41)]
|
||||
public ItemSpecialCounts SpecialCounts { get; set; }
|
||||
|
||||
[ProtoMember(42)]
|
||||
public AudioInfo AudioInfo { get; set; }
|
||||
|
||||
[ProtoMember(43)]
|
||||
public VideoInfo VideoInfo { get; set; }
|
||||
|
||||
public bool IsType(Type type)
|
||||
@@ -103,6 +166,7 @@ namespace MediaBrowser.Model.DTO
|
||||
return Type.Equals(type, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
[ProtoMember(44)]
|
||||
public bool IsNew { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
18
MediaBrowser.Model/DTO/DTOUser.cs
Normal file
18
MediaBrowser.Model/DTO/DTOUser.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using ProtoBuf;
|
||||
|
||||
namespace MediaBrowser.Model.DTO
|
||||
{
|
||||
[ProtoContract]
|
||||
public class DTOUser
|
||||
{
|
||||
[ProtoMember(1)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[ProtoMember(2)]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
[ProtoMember(3)]
|
||||
public bool HasImage { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,48 +1,65 @@
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System;
|
||||
using System;
|
||||
using ProtoBuf;
|
||||
|
||||
namespace MediaBrowser.Model.DTO
|
||||
{
|
||||
/// <summary>
|
||||
/// This is a stub class used by the api to get IBN types along with their item counts
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public class IBNItem
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the person, genre, etc
|
||||
/// </summary>
|
||||
[ProtoMember(1)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The id of the person, genre, etc
|
||||
/// </summary>
|
||||
[ProtoMember(2)]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
[ProtoMember(3)]
|
||||
public bool HasImage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The number of items that have the genre, year, studio, etc
|
||||
/// </summary>
|
||||
[ProtoMember(4)]
|
||||
public int BaseItemCount { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the api to get information about a Person within a BaseItem
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public class BaseItemPerson
|
||||
{
|
||||
[ProtoMember(1)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[ProtoMember(2)]
|
||||
public string Overview { get; set; }
|
||||
|
||||
[ProtoMember(3)]
|
||||
public string Type { get; set; }
|
||||
|
||||
[ProtoMember(4)]
|
||||
public bool HasImage { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the api to get information about a studio within a BaseItem
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public class BaseItemStudio
|
||||
{
|
||||
[ProtoMember(1)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[ProtoMember(2)]
|
||||
public bool HasImage { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,30 @@
|
||||
using System;
|
||||
using ProtoBuf;
|
||||
|
||||
namespace MediaBrowser.Model.DTO
|
||||
{
|
||||
/// <summary>
|
||||
/// This is a serializable stub class that is used by the api to provide information about installed plugins.
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public class PluginInfo
|
||||
{
|
||||
[ProtoMember(1)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[ProtoMember(2)]
|
||||
public string Path { get; set; }
|
||||
|
||||
[ProtoMember(3)]
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
[ProtoMember(4)]
|
||||
public bool DownloadToUI { get; set; }
|
||||
|
||||
[ProtoMember(5)]
|
||||
public DateTime ConfigurationDateLastModified { get; set; }
|
||||
|
||||
[ProtoMember(6)]
|
||||
public Version Version { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,31 @@
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using ProtoBuf;
|
||||
|
||||
namespace MediaBrowser.Model.DTO
|
||||
{
|
||||
[ProtoContract]
|
||||
public class VideoInfo
|
||||
{
|
||||
[ProtoMember(1)]
|
||||
public string Codec { get; set; }
|
||||
|
||||
[ProtoMember(2)]
|
||||
public int Height { get; set; }
|
||||
|
||||
[ProtoMember(3)]
|
||||
public int Width { get; set; }
|
||||
|
||||
[ProtoMember(4)]
|
||||
public string ScanType { get; set; }
|
||||
|
||||
[ProtoMember(5)]
|
||||
public VideoType VideoType { get; set; }
|
||||
|
||||
[ProtoMember(6)]
|
||||
public IEnumerable<SubtitleStream> Subtitles { get; set; }
|
||||
|
||||
[ProtoMember(7)]
|
||||
public IEnumerable<AudioStream> AudioStreams { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user