Pushing missing changes

This commit is contained in:
LukePulverenti
2013-02-20 20:33:05 -05:00
parent 845554722e
commit 767cdc1f6f
924 changed files with 103121 additions and 18677 deletions

View File

@@ -1,11 +0,0 @@
using ProtoBuf;
namespace MediaBrowser.Model.Authentication
{
[ProtoContract]
public class AuthenticationResult
{
[ProtoMember(1)]
public bool Success { get; set; }
}
}

View File

@@ -1,24 +1,80 @@
using ProtoBuf;
namespace MediaBrowser.Model.Configuration
{
/// <summary>
/// Serves as a common base class for the Server and UI application Configurations
/// ProtoInclude tells Protobuf about subclasses,
/// The number 50 can be any number, so long as it doesn't clash with any of the ProtoMember numbers either here or in subclasses.
/// </summary>
[ProtoContract, ProtoInclude(50, typeof(ServerConfiguration))]
public class BaseApplicationConfiguration
{
[ProtoMember(1)]
public bool EnableDebugLevelLogging { get; set; }
[ProtoMember(2)]
public int HttpServerPortNumber { get; set; }
public BaseApplicationConfiguration()
{
HttpServerPortNumber = 8096;
}
}
}
using ProtoBuf;
namespace MediaBrowser.Model.Configuration
{
/// <summary>
/// Serves as a common base class for the Server and UI application Configurations
/// ProtoInclude tells Protobuf about subclasses,
/// The number 50 can be any number, so long as it doesn't clash with any of the ProtoMember numbers either here or in subclasses.
/// </summary>
[ProtoContract, ProtoInclude(965, typeof(ServerConfiguration))]
public class BaseApplicationConfiguration
{
/// <summary>
/// Gets or sets a value indicating whether [enable debug level logging].
/// </summary>
/// <value><c>true</c> if [enable debug level logging]; otherwise, <c>false</c>.</value>
[ProtoMember(1)]
public bool EnableDebugLevelLogging { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [enable HTTP level logging].
/// </summary>
/// <value><c>true</c> if [enable HTTP level logging]; otherwise, <c>false</c>.</value>
[ProtoMember(56)]
public bool EnableHttpLevelLogging { get; set; }
/// <summary>
/// Gets or sets the HTTP server port number.
/// </summary>
/// <value>The HTTP server port number.</value>
[ProtoMember(2)]
public int HttpServerPortNumber { get; set; }
/// <summary>
/// Enable automatically and silently updating of the application
/// </summary>
/// <value><c>true</c> if [enable auto update]; otherwise, <c>false</c>.</value>
[ProtoMember(3)]
public bool EnableAutoUpdate { get; set; }
/// <summary>
/// The number of days we should retain log files
/// </summary>
/// <value>The log file retention days.</value>
[ProtoMember(5)]
public int LogFileRetentionDays { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [run at startup].
/// </summary>
/// <value><c>true</c> if [run at startup]; otherwise, <c>false</c>.</value>
[ProtoMember(58)]
public bool RunAtStartup { get; set; }
/// <summary>
/// Gets or sets the legacy web socket port number.
/// </summary>
/// <value>The legacy web socket port number.</value>
[ProtoMember(59)]
public int LegacyWebSocketPortNumber { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
/// </summary>
public BaseApplicationConfiguration()
{
HttpServerPortNumber = 8096;
LegacyWebSocketPortNumber = 8945;
EnableAutoUpdate = true;
LogFileRetentionDays = 14;
EnableHttpLevelLogging = true;
#if (DEBUG)
EnableDebugLevelLogging = true;
#endif
}
}
}

View File

@@ -1,30 +1,342 @@
using MediaBrowser.Model.Weather;
using ProtoBuf;
namespace MediaBrowser.Model.Configuration
{
/// <summary>
/// Represents the server configuration.
/// </summary>
[ProtoContract]
public class ServerConfiguration : BaseApplicationConfiguration
{
[ProtoMember(3)]
public bool EnableInternetProviders { get; set; }
[ProtoMember(4)]
public bool EnableUserProfiles { get; set; }
[ProtoMember(5)]
public string WeatherZipCode { get; set; }
[ProtoMember(6)]
public WeatherUnits WeatherUnit { get; set; }
public ServerConfiguration()
: base()
{
EnableUserProfiles = true;
}
}
}
using MediaBrowser.Model.Weather;
using ProtoBuf;
using System;
namespace MediaBrowser.Model.Configuration
{
/// <summary>
/// Represents the server configuration.
/// </summary>
[ProtoContract]
public class ServerConfiguration : BaseApplicationConfiguration
{
/// <summary>
/// Gets or sets a value indicating whether [enable internet providers].
/// </summary>
/// <value><c>true</c> if [enable internet providers]; otherwise, <c>false</c>.</value>
[ProtoMember(6)]
public bool EnableInternetProviders { get; set; }
/// <summary>
/// Gets or sets the zip code to use when displaying weather
/// </summary>
/// <value>The weather location.</value>
[ProtoMember(7)]
public string WeatherLocation { get; set; }
/// <summary>
/// Gets or sets the weather unit to use when displaying weather
/// </summary>
/// <value>The weather unit.</value>
[ProtoMember(8)]
public WeatherUnits WeatherUnit { get; set; }
/// <summary>
/// Gets or sets the metadata refresh days.
/// </summary>
/// <value>The metadata refresh days.</value>
[ProtoMember(9)]
public int MetadataRefreshDays { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [save local meta].
/// </summary>
/// <value><c>true</c> if [save local meta]; otherwise, <c>false</c>.</value>
[ProtoMember(10)]
public bool SaveLocalMeta { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [refresh item images].
/// </summary>
/// <value><c>true</c> if [refresh item images]; otherwise, <c>false</c>.</value>
[ProtoMember(11)]
public bool RefreshItemImages { get; set; }
/// <summary>
/// Gets or sets the preferred metadata language.
/// </summary>
/// <value>The preferred metadata language.</value>
[ProtoMember(12)]
public string PreferredMetadataLanguage { get; set; }
/// <summary>
/// Gets or sets the metadata country code.
/// </summary>
/// <value>The metadata country code.</value>
[ProtoMember(13)]
public string MetadataCountryCode { get; set; }
/// <summary>
/// Gets or sets the size of the TMDB fetched poster.
/// </summary>
/// <value>The size of the TMDB fetched poster.</value>
[ProtoMember(14)]
public string TmdbFetchedPosterSize { get; set; }
/// <summary>
/// Gets or sets the size of the TMDB fetched profile.
/// </summary>
/// <value>The size of the TMDB fetched profile.</value>
[ProtoMember(15)]
public string TmdbFetchedProfileSize { get; set; }
/// <summary>
/// Gets or sets the size of the TMDB fetched backdrop.
/// </summary>
/// <value>The size of the TMDB fetched backdrop.</value>
[ProtoMember(16)]
public string TmdbFetchedBackdropSize { get; set; }
/// <summary>
/// Gets or sets the max backdrops.
/// </summary>
/// <value>The max backdrops.</value>
[ProtoMember(17)]
public int MaxBackdrops { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [download movie art].
/// </summary>
/// <value><c>true</c> if [download movie art]; otherwise, <c>false</c>.</value>
[ProtoMember(40)]
public bool DownloadMovieArt { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [download movie logo].
/// </summary>
/// <value><c>true</c> if [download movie logo]; otherwise, <c>false</c>.</value>
[ProtoMember(41)]
public bool DownloadMovieLogo { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [download movie disc].
/// </summary>
/// <value><c>true</c> if [download movie disc]; otherwise, <c>false</c>.</value>
[ProtoMember(42)]
public bool DownloadMovieDisc { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [download TV art].
/// </summary>
/// <value><c>true</c> if [download TV art]; otherwise, <c>false</c>.</value>
[ProtoMember(43)]
public bool DownloadTVArt { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [download TV logo].
/// </summary>
/// <value><c>true</c> if [download TV logo]; otherwise, <c>false</c>.</value>
[ProtoMember(44)]
public bool DownloadTVLogo { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [download TV thumb].
/// </summary>
/// <value><c>true</c> if [download TV thumb]; otherwise, <c>false</c>.</value>
[ProtoMember(45)]
public bool DownloadTVThumb { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [download movie banner].
/// </summary>
/// <value><c>true</c> if [download movie banner]; otherwise, <c>false</c>.</value>
[ProtoMember(46)]
public bool DownloadMovieBanner { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [download movie thumb].
/// </summary>
/// <value><c>true</c> if [download movie thumb]; otherwise, <c>false</c>.</value>
[ProtoMember(47)]
public bool DownloadMovieThumb { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [download TV banner].
/// </summary>
/// <value><c>true</c> if [download TV banner]; otherwise, <c>false</c>.</value>
[ProtoMember(48)]
public bool DownloadTVBanner { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [download TV season banner].
/// </summary>
/// <value><c>true</c> if [download TV season banner]; otherwise, <c>false</c>.</value>
[ProtoMember(49)]
public bool DownloadTVSeasonBanner { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [download TV season thumb].
/// </summary>
/// <value><c>true</c> if [download TV season thumb]; otherwise, <c>false</c>.</value>
[ProtoMember(50)]
public bool DownloadTVSeasonThumb { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [download TV season backdrops].
/// </summary>
/// <value><c>true</c> if [download TV season banner]; otherwise, <c>false</c>.</value>
[ProtoMember(51)]
public bool DownloadTVSeasonBackdrops { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [download TV season backdrops].
/// </summary>
/// <value><c>true</c> if [download TV season banner]; otherwise, <c>false</c>.</value>
[ProtoMember(52)]
public bool DownloadHDFanArt { get; set; }
/// <summary>
/// Gets or sets the name of the item repository that should be used
/// </summary>
/// <value>The item repository.</value>
[ProtoMember(24)]
public string ItemRepository { get; set; }
/// <summary>
/// Gets or sets the name of the user repository that should be used
/// </summary>
/// <value>The user repository.</value>
[ProtoMember(25)]
public string UserRepository { get; set; }
/// <summary>
/// Gets or sets the name of the user data repository that should be used
/// </summary>
/// <value>The user data repository.</value>
[ProtoMember(26)]
public string UserDataRepository { get; set; }
/// <summary>
/// Characters to be replaced with a ' ' in strings to create a sort name
/// </summary>
/// <value>The sort replace characters.</value>
[ProtoMember(27)]
public string[] SortReplaceCharacters { get; set; }
/// <summary>
/// Characters to be removed from strings to create a sort name
/// </summary>
/// <value>The sort remove characters.</value>
[ProtoMember(28)]
public string[] SortRemoveCharacters { get; set; }
/// <summary>
/// Words to be removed from strings to create a sort name
/// </summary>
/// <value>The sort remove words.</value>
[ProtoMember(29)]
public string[] SortRemoveWords { get; set; }
/// <summary>
/// Show an output log window for debugging
/// </summary>
/// <value><c>true</c> if [show log window]; otherwise, <c>false</c>.</value>
[ProtoMember(30)]
public bool ShowLogWindow { get; set; }
/// <summary>
/// Gets or sets the name of the user data repository that should be used
/// </summary>
/// <value>The display preferences repository.</value>
[ProtoMember(31)]
public string DisplayPreferencesRepository { get; set; }
/// <summary>
/// The list of types that will NOT be allowed to have internet providers run against them even if they are turned on.
/// </summary>
/// <value>The internet provider exclude types.</value>
[ProtoMember(32)]
public string[] InternetProviderExcludeTypes { get; set; }
/// <summary>
/// Gets or sets the recent item days.
/// </summary>
/// <value>The recent item days.</value>
[ProtoMember(34)]
public int RecentItemDays { get; set; }
/// <summary>
/// Gets or sets the recently played days.
/// </summary>
/// <value>The recently played days.</value>
[ProtoMember(35)]
public int RecentlyPlayedDays { get; set; }
/// <summary>
/// Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated.
/// </summary>
/// <value>The min resume PCT.</value>
[ProtoMember(36)]
public int MinResumePct { get; set; }
/// <summary>
/// Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.
/// </summary>
/// <value>The max resume PCT.</value>
[ProtoMember(37)]
public int MaxResumePct { get; set; }
/// <summary>
/// Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates..
/// </summary>
/// <value>The min resume duration seconds.</value>
[ProtoMember(38)]
public int MinResumeDurationSeconds { get; set; }
/// <summary>
/// The delay in seconds that we will wait after a file system change to try and discover what has been added/removed
/// Some delay is necessary with some items because their creation is not atomic. It involves the creation of several
/// different directories and files.
/// </summary>
/// <value>The file watcher delay.</value>
[ProtoMember(55)]
public int FileWatcherDelay { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [enable developer tools].
/// </summary>
/// <value><c>true</c> if [enable developer tools]; otherwise, <c>false</c>.</value>
[ProtoMember(57)]
public bool EnableDeveloperTools { get; set; }
// Next Proto number ====> 59
/// <summary>
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
/// </summary>
public ServerConfiguration()
: base()
{
#if (DEBUG)
EnableDeveloperTools = true;
#endif
MinResumePct = 5;
MaxResumePct = 90;
MinResumeDurationSeconds = Convert.ToInt32(TimeSpan.FromMinutes(5).TotalSeconds);
FileWatcherDelay = 8;
RecentItemDays = 14;
RecentlyPlayedDays = 14;
EnableInternetProviders = true; //initial installs will need these
InternetProviderExcludeTypes = new string[] { };
MetadataRefreshDays = 30;
PreferredMetadataLanguage = "en";
MetadataCountryCode = "US";
TmdbFetchedProfileSize = "w185"; //w185 w45 h632 or original
TmdbFetchedPosterSize = "w500"; //w500, w342, w185 or original
TmdbFetchedBackdropSize = "w1280"; //w1280, w780 or original
DownloadTVSeasonBanner = true;
DownloadTVBanner = true;
DownloadHDFanArt = true;
MaxBackdrops = 4;
SortReplaceCharacters = new [] { ".", "+", "%" };
SortRemoveCharacters = new [] { ",", "&", "-", "{", "}", "'" };
SortRemoveWords = new [] { "the", "a", "an" };
}
}
}

View File

@@ -0,0 +1,61 @@
using ProtoBuf;
namespace MediaBrowser.Model.Configuration
{
/// <summary>
/// Class UserConfiguration
/// </summary>
[ProtoContract]
public class UserConfiguration
{
/// <summary>
/// Gets or sets the max parental rating.
/// </summary>
/// <value>The max parental rating.</value>
[ProtoMember(1)]
public int? MaxParentalRating { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [use custom library].
/// </summary>
/// <value><c>true</c> if [use custom library]; otherwise, <c>false</c>.</value>
[ProtoMember(2)]
public bool UseCustomLibrary { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is administrator.
/// </summary>
/// <value><c>true</c> if this instance is administrator; otherwise, <c>false</c>.</value>
[ProtoMember(3)]
public bool IsAdministrator { get; set; }
/// <summary>
/// Gets or sets the audio language preference.
/// </summary>
/// <value>The audio language preference.</value>
[ProtoMember(4)]
public string AudioLanguagePreference { get; set; }
/// <summary>
/// Gets or sets the subtitle language preference.
/// </summary>
/// <value>The subtitle language preference.</value>
[ProtoMember(5)]
public string SubtitleLanguagePreference { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [use forced subtitles only].
/// </summary>
/// <value><c>true</c> if [use forced subtitles only]; otherwise, <c>false</c>.</value>
[ProtoMember(6)]
public bool UseForcedSubtitlesOnly { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="UserConfiguration" /> class.
/// </summary>
public UserConfiguration()
{
IsAdministrator = true;
}
}
}

View File

@@ -0,0 +1,55 @@
using MediaBrowser.Model.Entities;
using ProtoBuf;
using System;
namespace MediaBrowser.Model.Connectivity
{
/// <summary>
/// Class ClientConnectionInfo
/// </summary>
[ProtoContract]
public class ClientConnectionInfo
{
/// <summary>
/// Gets or sets the user id.
/// </summary>
/// <value>The user id.</value>
[ProtoMember(1)]
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the type of the client.
/// </summary>
/// <value>The type of the client.</value>
[ProtoMember(2)]
public ClientType ClientType { get; set; }
/// <summary>
/// Gets or sets the last activity date.
/// </summary>
/// <value>The last activity date.</value>
[ProtoMember(3)]
public DateTime LastActivityDate { get; set; }
/// <summary>
/// Gets or sets the name of the device.
/// </summary>
/// <value>The name of the device.</value>
[ProtoMember(4)]
public string DeviceName { get; set; }
/// <summary>
/// Gets or sets the now playing item.
/// </summary>
/// <value>The now playing item.</value>
[ProtoMember(5)]
public BaseItemInfo NowPlayingItem { get; set; }
/// <summary>
/// Gets or sets the now playing position ticks.
/// </summary>
/// <value>The now playing position ticks.</value>
[ProtoMember(6)]
public long? NowPlayingPositionTicks { get; set; }
}
}

View File

@@ -0,0 +1,37 @@
namespace MediaBrowser.Model.Connectivity
{
/// <summary>
/// Enum ClientType
/// </summary>
public enum ClientType
{
/// <summary>
/// The other
/// </summary>
Other,
/// <summary>
/// The android
/// </summary>
Android,
/// <summary>
/// The dashboard
/// </summary>
Dashboard,
/// <summary>
/// The ios
/// </summary>
Ios,
/// <summary>
/// The pc
/// </summary>
Pc,
/// <summary>
/// The windows phone
/// </summary>
WindowsPhone,
/// <summary>
/// The windows RT
/// </summary>
WindowsRT
}
}

View File

@@ -1,23 +0,0 @@
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; }
}
}

View File

@@ -1,15 +0,0 @@

namespace MediaBrowser.Model.DTO
{
/// <summary>
/// These are the audio output formats that the api is cabaple of streaming
/// This does not limit the inputs, only the outputs.
/// </summary>
public enum AudioOutputFormats
{
Aac,
Flac,
Mp3,
Wma
}
}

View File

@@ -0,0 +1,57 @@
using ProtoBuf;
using System;
using System.ComponentModel;
using System.Runtime.Serialization;
namespace MediaBrowser.Model.DTO
{
/// <summary>
/// This is used by the api to get information about a Person within a BaseItem
/// </summary>
[ProtoContract]
public class BaseItemPerson : INotifyPropertyChanged
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(1)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the role.
/// </summary>
/// <value>The role.</value>
[ProtoMember(2)]
public string Role { get; set; }
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
[ProtoMember(3)]
public string Type { get; set; }
/// <summary>
/// Gets or sets the primary image tag.
/// </summary>
/// <value>The primary image tag.</value>
[ProtoMember(4)]
public Guid? PrimaryImageTag { get; set; }
/// <summary>
/// Gets a value indicating whether this instance has primary image.
/// </summary>
/// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool HasPrimaryImage
{
get { return PrimaryImageTag.HasValue; }
}
/// <summary>
/// Occurs when [property changed].
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
}
}

View File

@@ -0,0 +1,47 @@
using ProtoBuf;
using System;
using System.ComponentModel;
using System.Runtime.Serialization;
namespace MediaBrowser.Model.DTO
{
/// <summary>
/// Class ChapterInfo
/// </summary>
[ProtoContract]
public class ChapterInfoDto : INotifyPropertyChanged
{
/// <summary>
/// Gets or sets the start position ticks.
/// </summary>
/// <value>The start position ticks.</value>
[ProtoMember(1)]
public long StartPositionTicks { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(2)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the image tag.
/// </summary>
/// <value>The image tag.</value>
[ProtoMember(3)]
public Guid? ImageTag { get; set; }
/// <summary>
/// Gets a value indicating whether this instance has image.
/// </summary>
/// <value><c>true</c> if this instance has image; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool HasImage
{
get { return ImageTag.HasValue; }
}
public event PropertyChangedEventHandler PropertyChanged;
}
}

View File

@@ -1,178 +1,639 @@
using MediaBrowser.Model.Entities;
using ProtoBuf;
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.DTO
{
/// <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>
[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; }
[ProtoMember(9)]
public string[] Taglines { get; set; }
[ProtoMember(10)]
public string[] Genres { get; set; }
[ProtoMember(11)]
public string DisplayMediaType { get; set; }
[ProtoMember(12)]
public float? CommunityRating { 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; }
[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; }
[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; }
[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 DtoUserItemData UserData { get; set; }
[ProtoMember(41)]
public ItemSpecialCounts SpecialCounts { get; set; }
[ProtoMember(42)]
public AudioInfo AudioInfo { get; set; }
[ProtoMember(43)]
public VideoInfo VideoInfo { get; set; }
[ProtoMember(44)]
public SeriesInfo SeriesInfo { get; set; }
[ProtoMember(45)]
public MovieInfo MovieInfo { get; set; }
[ProtoMember(46)]
public bool IsNew { get; set; }
public bool IsType(Type type)
{
return IsType(type.Name);
}
public bool IsType(string type)
{
return Type.Equals(type, StringComparison.OrdinalIgnoreCase);
}
}
}
using System.ComponentModel;
using MediaBrowser.Model.Entities;
using ProtoBuf;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace MediaBrowser.Model.DTO
{
/// <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>
[ProtoContract]
public class DtoBaseItem : IHasProviderIds, INotifyPropertyChanged
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(1)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the id.
/// </summary>
/// <value>The id.</value>
[ProtoMember(2)]
public string Id { get; set; }
/// <summary>
/// Gets or sets the date created.
/// </summary>
/// <value>The date created.</value>
[ProtoMember(3)]
public DateTime? DateCreated { get; set; }
/// <summary>
/// Gets or sets the name of the sort.
/// </summary>
/// <value>The name of the sort.</value>
[ProtoMember(4)]
public string SortName { get; set; }
/// <summary>
/// Gets or sets the premiere date.
/// </summary>
/// <value>The premiere date.</value>
[ProtoMember(5)]
public DateTime? PremiereDate { get; set; }
/// <summary>
/// Gets or sets the path.
/// </summary>
/// <value>The path.</value>
[ProtoMember(6)]
public string Path { get; set; }
/// <summary>
/// Gets or sets the official rating.
/// </summary>
/// <value>The official rating.</value>
[ProtoMember(7)]
public string OfficialRating { get; set; }
/// <summary>
/// Gets or sets the overview.
/// </summary>
/// <value>The overview.</value>
[ProtoMember(8)]
public string Overview { get; set; }
/// <summary>
/// Gets or sets the taglines.
/// </summary>
/// <value>The taglines.</value>
[ProtoMember(9)]
public List<string> Taglines { get; set; }
/// <summary>
/// Gets or sets the genres.
/// </summary>
/// <value>The genres.</value>
[ProtoMember(10)]
public List<string> Genres { get; set; }
/// <summary>
/// Gets or sets the community rating.
/// </summary>
/// <value>The community rating.</value>
[ProtoMember(11)]
public float? CommunityRating { get; set; }
/// <summary>
/// Gets or sets the run time ticks.
/// </summary>
/// <value>The run time ticks.</value>
[ProtoMember(12)]
public long? RunTimeTicks { get; set; }
/// <summary>
/// Gets or sets the aspect ratio.
/// </summary>
/// <value>The aspect ratio.</value>
[ProtoMember(13)]
public string AspectRatio { get; set; }
/// <summary>
/// Gets or sets the production year.
/// </summary>
/// <value>The production year.</value>
[ProtoMember(14)]
public int? ProductionYear { get; set; }
/// <summary>
/// Gets or sets the index number.
/// </summary>
/// <value>The index number.</value>
[ProtoMember(15)]
public int? IndexNumber { get; set; }
/// <summary>
/// Gets or sets the parent index number.
/// </summary>
/// <value>The parent index number.</value>
[ProtoMember(16)]
public int? ParentIndexNumber { get; set; }
/// <summary>
/// Gets or sets the trailer urls.
/// </summary>
/// <value>The trailer urls.</value>
[ProtoMember(17)]
public List<string> TrailerUrls { get; set; }
/// <summary>
/// Gets or sets the provider ids.
/// </summary>
/// <value>The provider ids.</value>
[ProtoMember(18)]
public Dictionary<string, string> ProviderIds { get; set; }
/// <summary>
/// Gets or sets the language.
/// </summary>
/// <value>The language.</value>
[ProtoMember(24)]
public string Language { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is folder.
/// </summary>
/// <value><c>true</c> if this instance is folder; otherwise, <c>false</c>.</value>
[ProtoMember(25)]
public bool IsFolder { get; set; }
/// <summary>
/// If the item is a Folder this will determine if it's the Root or not
/// </summary>
/// <value><c>null</c> if [is root] contains no value, <c>true</c> if [is root]; otherwise, <c>false</c>.</value>
[ProtoMember(26)]
public bool? IsRoot { get; set; }
/// <summary>
/// If the item is a Folder this will determine if it's a VF or not
/// </summary>
/// <value><c>null</c> if [is virtual folder] contains no value, <c>true</c> if [is virtual folder]; otherwise, <c>false</c>.</value>
[ProtoMember(27)]
public bool? IsVirtualFolder { get; set; }
/// <summary>
/// Gets or sets the parent id.
/// </summary>
/// <value>The parent id.</value>
[ProtoMember(28)]
public string ParentId { get; set; }
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
[ProtoMember(29)]
public string Type { get; set; }
/// <summary>
/// Gets or sets the people.
/// </summary>
/// <value>The people.</value>
[ProtoMember(30)]
public BaseItemPerson[] People { get; set; }
/// <summary>
/// Gets or sets the studios.
/// </summary>
/// <value>The studios.</value>
[ProtoMember(31)]
public List<string> Studios { get; set; }
/// <summary>
/// If the item does not have a logo, this will hold the Id of the Parent that has one.
/// </summary>
/// <value>The parent logo item id.</value>
[ProtoMember(32)]
public string ParentLogoItemId { get; set; }
/// <summary>
/// If the item does not have any backdrops, this will hold the Id of the Parent that has one.
/// </summary>
/// <value>The parent backdrop item id.</value>
[ProtoMember(33)]
public string ParentBackdropItemId { get; set; }
/// <summary>
/// Gets or sets the parent backdrop image tags.
/// </summary>
/// <value>The parent backdrop image tags.</value>
[ProtoMember(34)]
public List<Guid> ParentBackdropImageTags { get; set; }
/// <summary>
/// Gets or sets the local trailer count.
/// </summary>
/// <value>The local trailer count.</value>
[ProtoMember(35)]
public int? LocalTrailerCount { get; set; }
/// <summary>
/// User data for this item based on the user it's being requested for
/// </summary>
/// <value>The user data.</value>
[ProtoMember(36)]
public DtoUserItemData UserData { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is new.
/// </summary>
/// <value><c>true</c> if this instance is new; otherwise, <c>false</c>.</value>
[ProtoMember(37)]
public bool IsNew { get; set; }
/// <summary>
/// Gets or sets the recently added item count.
/// </summary>
/// <value>The recently added item count.</value>
[ProtoMember(38)]
public int? RecentlyAddedItemCount { get; set; }
/// <summary>
/// Gets or sets the recently added un played item count.
/// </summary>
/// <value>The recently added un played item count.</value>
[ProtoMember(39)]
public int? RecentlyAddedUnPlayedItemCount { get; set; }
/// <summary>
/// Gets or sets the resumable item count.
/// </summary>
/// <value>The resumable item count.</value>
[ProtoMember(40)]
public int? ResumableItemCount { get; set; }
/// <summary>
/// Gets or sets the played percentage.
/// </summary>
/// <value>The played percentage.</value>
[ProtoMember(41)]
public double? PlayedPercentage { get; set; }
/// <summary>
/// Gets or sets the recursive item count.
/// </summary>
/// <value>The recursive item count.</value>
[ProtoMember(42)]
public int? RecursiveItemCount { get; set; }
/// <summary>
/// Gets or sets the favorite item count.
/// </summary>
/// <value>The favorite item count.</value>
[ProtoMember(43)]
public int? FavoriteItemCount { get; set; }
/// <summary>
/// Gets or sets the child count.
/// </summary>
/// <value>The child count.</value>
[ProtoMember(44)]
public int? ChildCount { get; set; }
/// <summary>
/// Gets or sets the name of the series.
/// </summary>
/// <value>The name of the series.</value>
[ProtoMember(45)]
public string SeriesName { get; set; }
/// <summary>
/// Gets or sets the series id.
/// </summary>
/// <value>The series id.</value>
[ProtoMember(46)]
public string SeriesId { get; set; }
/// <summary>
/// Gets or sets the recently played item count.
/// </summary>
/// <value>The recently played item count.</value>
[ProtoMember(47)]
public int? RecentlyPlayedItemCount { get; set; }
/// <summary>
/// Gets or sets the special feature count.
/// </summary>
/// <value>The special feature count.</value>
[ProtoMember(48)]
public int? SpecialFeatureCount { get; set; }
/// <summary>
/// Gets or sets the display preferences.
/// </summary>
/// <value>The display preferences.</value>
[ProtoMember(49)]
public DisplayPreferences DisplayPreferences { get; set; }
/// <summary>
/// Gets or sets the status.
/// </summary>
/// <value>The status.</value>
[ProtoMember(50)]
public SeriesStatus? Status { get; set; }
/// <summary>
/// Gets or sets the air time.
/// </summary>
/// <value>The air time.</value>
[ProtoMember(51)]
public string AirTime { get; set; }
/// <summary>
/// Gets or sets the air days.
/// </summary>
/// <value>The air days.</value>
[ProtoMember(52)]
public List<DayOfWeek> AirDays { get; set; }
/// <summary>
/// Gets or sets the sort options.
/// </summary>
/// <value>The sort options.</value>
[ProtoMember(53)]
public string[] SortOptions { get; set; }
/// <summary>
/// Gets or sets the index options.
/// </summary>
/// <value>The index options.</value>
[ProtoMember(54)]
public string[] IndexOptions { get; set; }
/// <summary>
/// Gets or sets the primary image aspect ratio.
/// </summary>
/// <value>The primary image aspect ratio.</value>
[ProtoMember(55)]
public double? PrimaryImageAspectRatio { get; set; }
/// <summary>
/// Gets or sets the artist.
/// </summary>
/// <value>The artist.</value>
[ProtoMember(56)]
public string Artist { get; set; }
/// <summary>
/// Gets or sets the album.
/// </summary>
/// <value>The album.</value>
[ProtoMember(57)]
public string Album { get; set; }
/// <summary>
/// Gets or sets the album artist.
/// </summary>
/// <value>The album artist.</value>
[ProtoMember(58)]
public string AlbumArtist { get; set; }
/// <summary>
/// Gets or sets the media streams.
/// </summary>
/// <value>The media streams.</value>
[ProtoMember(59)]
public List<MediaStream> MediaStreams { get; set; }
/// <summary>
/// Gets or sets the type of the video.
/// </summary>
/// <value>The type of the video.</value>
[ProtoMember(60)]
public VideoType? VideoType { get; set; }
/// <summary>
/// Gets or sets the display type of the media.
/// </summary>
/// <value>The display type of the media.</value>
[ProtoMember(61)]
public string DisplayMediaType { get; set; }
/// <summary>
/// Determines whether the specified type is type.
/// </summary>
/// <param name="type">The type.</param>
/// <returns><c>true</c> if the specified type is type; otherwise, <c>false</c>.</returns>
public bool IsType(Type type)
{
return IsType(type.Name);
}
/// <summary>
/// Determines whether the specified type is type.
/// </summary>
/// <param name="type">The type.</param>
/// <returns><c>true</c> if the specified type is type; otherwise, <c>false</c>.</returns>
public bool IsType(string type)
{
return Type.Equals(type, StringComparison.OrdinalIgnoreCase);
}
/// <summary>
/// Gets a value indicating whether this instance can resume.
/// </summary>
/// <value><c>true</c> if this instance can resume; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool CanResume
{
get { return UserData != null && UserData.PlaybackPositionTicks > 0; }
}
/// <summary>
/// Gets the resume position ticks.
/// </summary>
/// <value>The resume position ticks.</value>
[IgnoreDataMember]
public long ResumePositionTicks
{
get { return UserData == null ? 0 : UserData.PlaybackPositionTicks; }
}
/// <summary>
/// Gets or sets the image tags.
/// </summary>
/// <value>The image tags.</value>
[ProtoMember(62)]
public Dictionary<ImageType, Guid> ImageTags { get; set; }
/// <summary>
/// Gets or sets the backdrop image tags.
/// </summary>
/// <value>The backdrop image tags.</value>
[ProtoMember(63)]
public List<Guid> BackdropImageTags { get; set; }
/// <summary>
/// Gets or sets the parent logo image tag.
/// </summary>
/// <value>The parent logo image tag.</value>
[ProtoMember(64)]
public Guid? ParentLogoImageTag { get; set; }
/// <summary>
/// Gets or sets the chapters.
/// </summary>
/// <value>The chapters.</value>
[ProtoMember(65)]
public List<ChapterInfoDto> Chapters { get; set; }
/// <summary>
/// Gets or sets the video format.
/// </summary>
/// <value>The video format.</value>
[ProtoMember(66)]
public VideoFormat? VideoFormat { get; set; }
/// <summary>
/// Gets or sets the type of the location.
/// </summary>
/// <value>The type of the location.</value>
[ProtoMember(67)]
public LocationType LocationType { get; set; }
/// <summary>
/// Gets or sets the type of the iso.
/// </summary>
/// <value>The type of the iso.</value>
[ProtoMember(68)]
public IsoType? IsoType { get; set; }
/// <summary>
/// Gets or sets the type of the media.
/// </summary>
/// <value>The type of the media.</value>
[ProtoMember(69)]
public string MediaType { get; set; }
/// <summary>
/// Gets the backdrop count.
/// </summary>
/// <value>The backdrop count.</value>
[IgnoreDataMember]
public int BackdropCount
{
get { return BackdropImageTags == null ? 0 : BackdropImageTags.Count; }
}
/// <summary>
/// Gets a value indicating whether this instance has banner.
/// </summary>
/// <value><c>true</c> if this instance has banner; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool HasBanner
{
get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Banner); }
}
/// <summary>
/// Gets a value indicating whether this instance has art.
/// </summary>
/// <value><c>true</c> if this instance has art; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool HasArtImage
{
get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Art); }
}
/// <summary>
/// Gets a value indicating whether this instance has logo.
/// </summary>
/// <value><c>true</c> if this instance has logo; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool HasLogo
{
get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Logo); }
}
/// <summary>
/// Gets a value indicating whether this instance has thumb.
/// </summary>
/// <value><c>true</c> if this instance has thumb; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool HasThumb
{
get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Thumb); }
}
/// <summary>
/// Gets a value indicating whether this instance has primary image.
/// </summary>
/// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool HasPrimaryImage
{
get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Primary); }
}
/// <summary>
/// Gets a value indicating whether this instance has disc image.
/// </summary>
/// <value><c>true</c> if this instance has disc image; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool HasDiscImage
{
get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Disc); }
}
/// <summary>
/// Gets a value indicating whether this instance has box image.
/// </summary>
/// <value><c>true</c> if this instance has box image; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool HasBoxImage
{
get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Box); }
}
/// <summary>
/// Gets a value indicating whether this instance has menu image.
/// </summary>
/// <value><c>true</c> if this instance has menu image; otherwise, <c>false</c>.</value>
public bool HasMenuImage
{
get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Menu); }
}
/// <summary>
/// Gets a value indicating whether this instance is video.
/// </summary>
/// <value><c>true</c> if this instance is video; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool HasTrailer
{
get { return LocalTrailerCount > 0 || (TrailerUrls != null && TrailerUrls.Count > 0); }
}
/// <summary>
/// Gets a value indicating whether this instance is video.
/// </summary>
/// <value><c>true</c> if this instance is video; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool IsVideo
{
get { return string.Equals(MediaType, Entities.MediaType.Video, StringComparison.OrdinalIgnoreCase); }
}
/// <summary>
/// Gets a value indicating whether this instance is audio.
/// </summary>
/// <value><c>true</c> if this instance is audio; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool IsAudio
{
get { return string.Equals(MediaType, Entities.MediaType.Audio, StringComparison.OrdinalIgnoreCase); }
}
/// <summary>
/// Gets a value indicating whether this instance is game.
/// </summary>
/// <value><c>true</c> if this instance is game; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool IsGame
{
get { return string.Equals(MediaType, Entities.MediaType.Game, StringComparison.OrdinalIgnoreCase); }
}
/// <summary>
/// Occurs when [property changed].
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
}
}

View File

@@ -1,27 +1,76 @@
using ProtoBuf;
using System;
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; }
[ProtoMember(4)]
public bool HasPassword { get; set; }
[ProtoMember(5)]
public DateTime? LastLoginDate { get; set; }
[ProtoMember(6)]
public DateTime? LastActivityDate { get; set; }
}
}
using System.ComponentModel;
using MediaBrowser.Model.Configuration;
using ProtoBuf;
using System;
using System.Runtime.Serialization;
namespace MediaBrowser.Model.DTO
{
/// <summary>
/// Class DtoUser
/// </summary>
[ProtoContract]
public class DtoUser : INotifyPropertyChanged
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(1)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the id.
/// </summary>
/// <value>The id.</value>
[ProtoMember(2)]
public Guid Id { get; set; }
/// <summary>
/// Gets or sets the primary image tag.
/// </summary>
/// <value>The primary image tag.</value>
[ProtoMember(3)]
public Guid? PrimaryImageTag { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance has password.
/// </summary>
/// <value><c>true</c> if this instance has password; otherwise, <c>false</c>.</value>
[ProtoMember(4)]
public bool HasPassword { get; set; }
/// <summary>
/// Gets or sets the last login date.
/// </summary>
/// <value>The last login date.</value>
[ProtoMember(5)]
public DateTime? LastLoginDate { get; set; }
/// <summary>
/// Gets or sets the last activity date.
/// </summary>
/// <value>The last activity date.</value>
[ProtoMember(6)]
public DateTime? LastActivityDate { get; set; }
/// <summary>
/// Gets or sets the configuration.
/// </summary>
/// <value>The configuration.</value>
[ProtoMember(7)]
public UserConfiguration Configuration { get; set; }
/// <summary>
/// Gets a value indicating whether this instance has primary image.
/// </summary>
/// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool HasPrimaryImage
{
get { return PrimaryImageTag.HasValue; }
}
public event PropertyChangedEventHandler PropertyChanged;
}
}

View File

@@ -1,23 +1,56 @@
using ProtoBuf;
namespace MediaBrowser.Model.DTO
{
[ProtoContract]
public class DtoUserItemData
{
[ProtoMember(1)]
public float? Rating { get; set; }
[ProtoMember(2)]
public long PlaybackPositionTicks { get; set; }
[ProtoMember(3)]
public int PlayCount { get; set; }
[ProtoMember(4)]
public bool IsFavorite { get; set; }
[ProtoMember(5)]
public bool? Likes { get; set; }
}
}
using System.ComponentModel;
using ProtoBuf;
namespace MediaBrowser.Model.DTO
{
/// <summary>
/// Class DtoUserItemData
/// </summary>
[ProtoContract]
public class DtoUserItemData : INotifyPropertyChanged
{
/// <summary>
/// Gets or sets the rating.
/// </summary>
/// <value>The rating.</value>
[ProtoMember(1)]
public float? Rating { get; set; }
/// <summary>
/// Gets or sets the playback position ticks.
/// </summary>
/// <value>The playback position ticks.</value>
[ProtoMember(2)]
public long PlaybackPositionTicks { get; set; }
/// <summary>
/// Gets or sets the play count.
/// </summary>
/// <value>The play count.</value>
[ProtoMember(3)]
public int PlayCount { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is favorite.
/// </summary>
/// <value><c>true</c> if this instance is favorite; otherwise, <c>false</c>.</value>
[ProtoMember(4)]
public bool IsFavorite { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this <see cref="DtoUserItemData" /> is likes.
/// </summary>
/// <value><c>null</c> if [likes] contains no value, <c>true</c> if [likes]; otherwise, <c>false</c>.</value>
[ProtoMember(5)]
public bool? Likes { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this <see cref="DtoUserItemData" /> is played.
/// </summary>
/// <value><c>true</c> if played; otherwise, <c>false</c>.</value>
[ProtoMember(6)]
public bool Played { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
}
}

View File

@@ -1,65 +0,0 @@
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; }
}
}

View File

@@ -0,0 +1,61 @@

using System;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.DTO
{
/// <summary>
/// Class ImageOptions
/// </summary>
public class ImageOptions
{
/// <summary>
/// Gets or sets the type of the image.
/// </summary>
/// <value>The type of the image.</value>
public ImageType ImageType { get; set; }
/// <summary>
/// Gets or sets the index of the image.
/// </summary>
/// <value>The index of the image.</value>
public int? ImageIndex { get; set; }
/// <summary>
/// Gets or sets the width.
/// </summary>
/// <value>The width.</value>
public int? Width { get; set; }
/// <summary>
/// Gets or sets the height.
/// </summary>
/// <value>The height.</value>
public int? Height { get; set; }
/// <summary>
/// Gets or sets the width of the max.
/// </summary>
/// <value>The width of the max.</value>
public int? MaxWidth { get; set; }
/// <summary>
/// Gets or sets the height of the max.
/// </summary>
/// <value>The height of the max.</value>
public int? MaxHeight { get; set; }
/// <summary>
/// Gets or sets the quality.
/// </summary>
/// <value>The quality.</value>
public int? Quality { get; set; }
/// <summary>
/// Gets or sets the image tag.
/// If set this will result in strong, unconditional response caching
/// </summary>
/// <value>The hash.</value>
public Guid? Tag { get; set; }
}
}

View File

@@ -0,0 +1,119 @@

namespace MediaBrowser.Model.DTO
{
/// <summary>
/// Used to control the data that gets attached to DtoBaseItems
/// </summary>
public enum ItemFields
{
/// <summary>
/// Audio properties
/// </summary>
AudioInfo,
/// <summary>
/// The chapters
/// </summary>
Chapters,
/// <summary>
/// The date created of the item
/// </summary>
DateCreated,
/// <summary>
/// The display media type
/// </summary>
DisplayMediaType,
/// <summary>
/// Item display preferences
/// </summary>
DisplayPreferences,
/// <summary>
/// Genres
/// </summary>
Genres,
/// <summary>
/// Child count, recursive child count, etc
/// </summary>
ItemCounts,
/// <summary>
/// The fields that the server supports indexing on
/// </summary>
IndexOptions,
/// <summary>
/// The item overview
/// </summary>
Overview,
/// <summary>
/// The id of the item's parent
/// </summary>
ParentId,
/// <summary>
/// The physical path of the item
/// </summary>
Path,
/// <summary>
/// The list of people for the item
/// </summary>
People,
/// <summary>
/// Imdb, tmdb, etc
/// </summary>
ProviderIds,
/// <summary>
/// The aspect ratio of the primary image
/// </summary>
PrimaryImageAspectRatio,
/// <summary>
/// AirDays, status, SeriesName, etc
/// </summary>
SeriesInfo,
/// <summary>
/// The sort name of the item
/// </summary>
SortName,
/// <summary>
/// The fields that the server supports sorting on
/// </summary>
SortOptions,
/// <summary>
/// The studios of the item
/// </summary>
Studios,
/// <summary>
/// The taglines of the item
/// </summary>
Taglines,
/// <summary>
/// The trailer url of the item
/// </summary>
TrailerUrls,
/// <summary>
/// The user data of the item
/// </summary>
UserData,
/// <summary>
/// The media streams
/// </summary>
MediaStreams
}
}

View File

@@ -0,0 +1,42 @@

namespace MediaBrowser.Model.DTO
{
/// <summary>
/// Enum ItemFilter
/// </summary>
public enum ItemFilter
{
/// <summary>
/// The item is a folder
/// </summary>
IsFolder = 1,
/// <summary>
/// The item is not folder
/// </summary>
IsNotFolder = 2,
/// <summary>
/// The item is unplayed
/// </summary>
IsUnplayed = 3,
/// <summary>
/// The item is played
/// </summary>
IsPlayed = 4,
/// <summary>
/// The item is a favorite
/// </summary>
IsFavorite = 5,
/// <summary>
/// The item is recently added
/// </summary>
IsRecentlyAdded = 6,
/// <summary>
/// The item is resumable
/// </summary>
IsResumable = 7,
/// <summary>
/// The item is recently played
/// </summary>
IsRecentlyPlayed = 8
}
}

View File

@@ -0,0 +1,131 @@
using MediaBrowser.Model.Entities;
using System;
namespace MediaBrowser.Model.DTO
{
/// <summary>
/// Contains all the possible parameters that can be used to query for items
/// </summary>
public class ItemQuery
{
/// <summary>
/// The user to localize search results for
/// </summary>
/// <value>The user id.</value>
public Guid UserId { get; set; }
/// <summary>
/// Specify this to localize the search to a specific item or folder. Omit to use the root.
/// </summary>
/// <value>The parent id.</value>
public string ParentId { get; set; }
/// <summary>
/// Skips over a given number of items within the results. Use for paging.
/// </summary>
/// <value>The start index.</value>
public int? StartIndex { get; set; }
/// <summary>
/// The maximum number of items to return
/// </summary>
/// <value>The limit.</value>
public int? Limit { get; set; }
/// <summary>
/// What to sort the results by
/// </summary>
/// <value>The sort by.</value>
public ItemSortBy[] SortBy { get; set; }
/// <summary>
/// The sort order to return results with
/// </summary>
/// <value>The sort order.</value>
public SortOrder? SortOrder { get; set; }
/// <summary>
/// Filters to apply to the results
/// </summary>
/// <value>The filters.</value>
public ItemFilter[] Filters { get; set; }
/// <summary>
/// Fields to return within the items, in addition to basic information
/// </summary>
/// <value>The fields.</value>
public ItemFields[] Fields { get; set; }
/// <summary>
/// Whether or not to perform the query recursively
/// </summary>
/// <value><c>true</c> if recursive; otherwise, <c>false</c>.</value>
public bool Recursive { get; set; }
/// <summary>
/// Limit results to items containing specific genres
/// </summary>
/// <value>The genres.</value>
public string[] Genres { get; set; }
/// <summary>
/// Limit results to items containing specific studios
/// </summary>
/// <value>The studios.</value>
public string[] Studios { get; set; }
/// <summary>
/// Gets or sets the exclude item types.
/// </summary>
/// <value>The exclude item types.</value>
public string[] ExcludeItemTypes { get; set; }
/// <summary>
/// Gets or sets the include item types.
/// </summary>
/// <value>The include item types.</value>
public string[] IncludeItemTypes { get; set; }
/// <summary>
/// Limit results to items containing specific years
/// </summary>
/// <value>The years.</value>
public int[] Years { get; set; }
/// <summary>
/// Limit results to items containing a specific person
/// </summary>
/// <value>The person.</value>
public string Person { get; set; }
/// <summary>
/// If the Person filter is used, this can also be used to restrict to a specific person type
/// </summary>
/// <value>The type of the person.</value>
public string PersonType { get; set; }
/// <summary>
/// Search characters used to find items
/// </summary>
/// <value>The index by.</value>
public string SearchTerm { get; set; }
/// <summary>
/// The dynamic, localized index function name
/// </summary>
/// <value>The index by.</value>
public string IndexBy { get; set; }
/// <summary>
/// The dynamic, localized sort function name
/// </summary>
/// <value>The dynamic sort by.</value>
public string DynamicSortBy { get; set; }
/// <summary>
/// Gets or sets the image types.
/// </summary>
/// <value>The image types.</value>
public ImageType[] ImageTypes { get; set; }
}
}

View File

@@ -0,0 +1,42 @@

namespace MediaBrowser.Model.DTO
{
/// <summary>
/// Enum ItemSortBy
/// </summary>
public enum ItemSortBy
{
/// <summary>
/// The album
/// </summary>
Album,
/// <summary>
/// The album artist
/// </summary>
AlbumArtist,
/// <summary>
/// The artist
/// </summary>
Artist,
/// <summary>
/// The date created
/// </summary>
DateCreated,
/// <summary>
/// The date played
/// </summary>
DatePlayed,
/// <summary>
/// The premiere date
/// </summary>
PremiereDate,
/// <summary>
/// The sort name
/// </summary>
SortName,
/// <summary>
/// The random
/// </summary>
Random
}
}

View File

@@ -0,0 +1,25 @@
using ProtoBuf;
namespace MediaBrowser.Model.DTO
{
/// <summary>
/// Represents the result of a query for items
/// </summary>
[ProtoContract]
public class ItemsResult
{
/// <summary>
/// The set of items returned based on sorting, paging, etc
/// </summary>
/// <value>The items.</value>
[ProtoMember(1)]
public DtoBaseItem[] Items { get; set; }
/// <summary>
/// The total number of records available
/// </summary>
/// <value>The total record count.</value>
[ProtoMember(2)]
public int TotalRecordCount { get; set; }
}
}

View File

@@ -0,0 +1,22 @@

namespace MediaBrowser.Model.DTO
{
/// <summary>
/// Enum MediaType
/// </summary>
public enum MediaType
{
/// <summary>
/// The audio
/// </summary>
Audio,
/// <summary>
/// The game
/// </summary>
Game,
/// <summary>
/// The video
/// </summary>
Video
}
}

View File

@@ -1,11 +0,0 @@
using ProtoBuf;
namespace MediaBrowser.Model.DTO
{
[ProtoContract]
public class MovieInfo
{
[ProtoMember(1)]
public int SpecialFeatureCount { get; set; }
}
}

View File

@@ -1,33 +0,0 @@
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 bool Enabled { get; set; }
[ProtoMember(3)]
public bool DownloadToUI { get; set; }
[ProtoMember(4)]
public DateTime ConfigurationDateLastModified { get; set; }
[ProtoMember(5)]
public string Version { get; set; }
[ProtoMember(6)]
public string AssemblyFileName { get; set; }
[ProtoMember(7)]
public string ConfigurationFileName { get; set; }
}
}

View File

@@ -1,18 +0,0 @@
using ProtoBuf;
using System;
namespace MediaBrowser.Model.DTO
{
[ProtoContract]
public class SeriesInfo
{
[ProtoMember(1)]
public string Status { get; set; }
[ProtoMember(2)]
public string AirTime { get; set; }
[ProtoMember(3)]
public DayOfWeek[] AirDays { get; set; }
}
}

View File

@@ -0,0 +1,174 @@
namespace MediaBrowser.Model.DTO
{
/// <summary>
/// Class VideoStreamOptions
/// </summary>
public class VideoStreamOptions : StreamOptions
{
/// <summary>
/// Gets or sets the video codec.
/// Omit to copy
/// </summary>
/// <value>The video codec.</value>
public VideoCodecs? VideoCodec { get; set; }
/// <summary>
/// Gets or sets the video bit rate.
/// </summary>
/// <value>The video bit rate.</value>
public int? VideoBitRate { get; set; }
/// <summary>
/// Gets or sets the width.
/// </summary>
/// <value>The width.</value>
public int? Width { get; set; }
/// <summary>
/// Gets or sets the height.
/// </summary>
/// <value>The height.</value>
public int? Height { get; set; }
/// <summary>
/// Gets or sets the width of the max.
/// </summary>
/// <value>The width of the max.</value>
public int? MaxWidth { get; set; }
/// <summary>
/// Gets or sets the height of the max.
/// </summary>
/// <value>The height of the max.</value>
public int? MaxHeight { get; set; }
/// <summary>
/// Gets or sets the frame rate.
/// </summary>
/// <value>The frame rate.</value>
public double? FrameRate { get; set; }
/// <summary>
/// Gets or sets the index of the audio stream.
/// </summary>
/// <value>The index of the audio stream.</value>
public int? AudioStreamIndex { get; set; }
/// <summary>
/// Gets or sets the index of the video stream.
/// </summary>
/// <value>The index of the video stream.</value>
public int? VideoStreamIndex { get; set; }
/// <summary>
/// Gets or sets the index of the subtitle stream.
/// </summary>
/// <value>The index of the subtitle stream.</value>
public int? SubtitleStreamIndex { get; set; }
}
/// <summary>
/// Class StreamOptions
/// </summary>
public abstract class StreamOptions
{
/// <summary>
/// Gets or sets the audio bit rate.
/// </summary>
/// <value>The audio bit rate.</value>
public int? AudioBitRate { get; set; }
/// <summary>
/// Gets or sets the audio codec.
/// Omit to copy the original stream
/// </summary>
/// <value>The audio encoding format.</value>
public AudioCodecs? AudioCodec { get; set; }
/// <summary>
/// Gets or sets the item id.
/// </summary>
/// <value>The item id.</value>
public string ItemId { get; set; }
/// <summary>
/// Gets or sets the max audio channels.
/// </summary>
/// <value>The max audio channels.</value>
public int? MaxAudioChannels { get; set; }
/// <summary>
/// Gets or sets the max audio sample rate.
/// </summary>
/// <value>The max audio sample rate.</value>
public int? MaxAudioSampleRate { get; set; }
/// <summary>
/// Gets or sets the start time ticks.
/// </summary>
/// <value>The start time ticks.</value>
public long? StartTimeTicks { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the original media should be served statically
/// Only used with progressive streaming
/// </summary>
/// <value><c>true</c> if static; otherwise, <c>false</c>.</value>
public bool? Static { get; set; }
/// <summary>
/// Gets or sets the output file extension.
/// </summary>
/// <value>The output file extension.</value>
public string OutputFileExtension { get; set; }
}
/// <summary>
/// These are the codecs the api is capable of encoding to
/// </summary>
public enum AudioCodecs
{
/// <summary>
/// The aac
/// </summary>
Aac,
/// <summary>
/// The MP3
/// </summary>
Mp3,
/// <summary>
/// The vorbis
/// </summary>
Vorbis,
/// <summary>
/// The wma
/// </summary>
Wma
}
/// <summary>
/// Enum VideoCodecs
/// </summary>
public enum VideoCodecs
{
/// <summary>
/// The H264
/// </summary>
H264,
/// <summary>
/// The theora
/// </summary>
Theora,
/// <summary>
/// The VPX
/// </summary>
Vpx,
/// <summary>
/// The WMV
/// </summary>
Wmv
}
}

View File

@@ -1,30 +0,0 @@
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 SubtitleStream[] Subtitles { get; set; }
[ProtoMember(7)]
public AudioStream[] AudioStreams { get; set; }
}
}

View File

@@ -1,22 +0,0 @@

namespace MediaBrowser.Model.DTO
{
/// <summary>
/// These are the video output formats that the api is cabaple of streaming
/// This does not limit the inputs, only the outputs.
/// </summary>
public enum VideoOutputFormats
{
Avi,
Asf,
M4V,
Mkv,
Mov,
Mp4,
Ogv,
ThreeGp,
Ts,
Webm,
Wmv
}
}

View File

@@ -0,0 +1,145 @@

namespace MediaBrowser.Model.Drawing
{
/// <summary>
/// Class DrawingUtils
/// </summary>
public static class DrawingUtils
{
/// <summary>
/// Resizes a set of dimensions
/// </summary>
/// <param name="currentWidth">Width of the current.</param>
/// <param name="currentHeight">Height of the current.</param>
/// <param name="scaleFactor">The scale factor.</param>
/// <returns>ImageSize.</returns>
public static ImageSize Scale(double currentWidth, double currentHeight, double scaleFactor)
{
return Scale(new ImageSize { Width = currentWidth, Height = currentHeight }, scaleFactor);
}
/// <summary>
/// Resizes a set of dimensions
/// </summary>
/// <param name="size">The size.</param>
/// <param name="scaleFactor">The scale factor.</param>
/// <returns>ImageSize.</returns>
public static ImageSize Scale(ImageSize size, double scaleFactor)
{
var newWidth = size.Width * scaleFactor;
return Resize(size.Width, size.Height, newWidth);
}
/// <summary>
/// Resizes a set of dimensions
/// </summary>
/// <param name="currentWidth">Width of the current.</param>
/// <param name="currentHeight">Height of the current.</param>
/// <param name="width">The width.</param>
/// <param name="height">The height.</param>
/// <param name="maxWidth">A max fixed width, if desired</param>
/// <param name="maxHeight">A max fixed height, if desired</param>
/// <returns>ImageSize.</returns>
public static ImageSize Resize(double currentWidth, double currentHeight, double? width = null, double? height = null, double? maxWidth = null, double? maxHeight = null)
{
return Resize(new ImageSize { Width = currentWidth, Height = currentHeight }, width, height, maxWidth, maxHeight);
}
/// <summary>
/// Resizes a set of dimensions
/// </summary>
/// <param name="size">The original size object</param>
/// <param name="width">A new fixed width, if desired</param>
/// <param name="height">A new fixed height, if desired</param>
/// <param name="maxWidth">A max fixed width, if desired</param>
/// <param name="maxHeight">A max fixed height, if desired</param>
/// <returns>A new size object</returns>
public static ImageSize Resize(ImageSize size, double? width = null, double? height = null, double? maxWidth = null, double? maxHeight = null)
{
double newWidth = size.Width;
double newHeight = size.Height;
if (width.HasValue && height.HasValue)
{
newWidth = width.Value;
newHeight = height.Value;
}
else if (height.HasValue)
{
newWidth = GetNewWidth(newHeight, newWidth, height.Value);
newHeight = height.Value;
}
else if (width.HasValue)
{
newHeight = GetNewHeight(newHeight, newWidth, width.Value);
newWidth = width.Value;
}
if (maxHeight.HasValue && maxHeight < newHeight)
{
newWidth = GetNewWidth(newHeight, newWidth, maxHeight.Value);
newHeight = maxHeight.Value;
}
if (maxWidth.HasValue && maxWidth < newWidth)
{
newHeight = GetNewHeight(newHeight, newWidth, maxWidth.Value);
newWidth = maxWidth.Value;
}
return new ImageSize { Width = newWidth, Height = newHeight };
}
/// <summary>
/// Gets the new width.
/// </summary>
/// <param name="currentHeight">Height of the current.</param>
/// <param name="currentWidth">Width of the current.</param>
/// <param name="newHeight">The new height.</param>
/// <returns>System.Double.</returns>
private static double GetNewWidth(double currentHeight, double currentWidth, double newHeight)
{
var scaleFactor = newHeight;
scaleFactor /= currentHeight;
scaleFactor *= currentWidth;
return scaleFactor;
}
/// <summary>
/// Gets the new height.
/// </summary>
/// <param name="currentHeight">Height of the current.</param>
/// <param name="currentWidth">Width of the current.</param>
/// <param name="newWidth">The new width.</param>
/// <returns>System.Double.</returns>
private static double GetNewHeight(double currentHeight, double currentWidth, double newWidth)
{
var scaleFactor = newWidth;
scaleFactor /= currentWidth;
scaleFactor *= currentHeight;
return scaleFactor;
}
}
/// <summary>
/// Struct ImageSize
/// </summary>
public struct ImageSize
{
/// <summary>
/// Gets or sets the height.
/// </summary>
/// <value>The height.</value>
public double Height { get; set; }
/// <summary>
/// Gets or sets the width.
/// </summary>
/// <value>The width.</value>
public double Width { get; set; }
}
}

View File

@@ -1,26 +0,0 @@
using ProtoBuf;
namespace MediaBrowser.Model.Entities
{
[ProtoContract]
public class AudioStream
{
[ProtoMember(1)]
public string Codec { get; set; }
[ProtoMember(2)]
public string Language { get; set; }
[ProtoMember(3)]
public int BitRate { get; set; }
[ProtoMember(4)]
public int Channels { get; set; }
[ProtoMember(5)]
public int SampleRate { get; set; }
[ProtoMember(6)]
public bool IsDefault { get; set; }
}
}

View File

@@ -0,0 +1,82 @@
using ProtoBuf;
using System;
using System.Runtime.Serialization;
namespace MediaBrowser.Model.Entities
{
/// <summary>
/// This is a stub class containing only basic information about an item
/// </summary>
[ProtoContract]
public class BaseItemInfo
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(1)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the id.
/// </summary>
/// <value>The id.</value>
[ProtoMember(2)]
public string Id { get; set; }
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
[ProtoMember(3)]
public string Type { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is folder.
/// </summary>
/// <value><c>true</c> if this instance is folder; otherwise, <c>false</c>.</value>
[ProtoMember(4)]
public bool IsFolder { get; set; }
/// <summary>
/// Gets or sets the run time ticks.
/// </summary>
/// <value>The run time ticks.</value>
[ProtoMember(5)]
public long? RunTimeTicks { get; set; }
/// <summary>
/// Gets or sets the primary image tag.
/// </summary>
/// <value>The primary image tag.</value>
[ProtoMember(6)]
public Guid? PrimaryImageTag { get; set; }
/// <summary>
/// Gets or sets the backdrop image tag.
/// </summary>
/// <value>The backdrop image tag.</value>
[ProtoMember(7)]
public Guid? BackdropImageTag { get; set; }
/// <summary>
/// Gets a value indicating whether this instance has primary image.
/// </summary>
/// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool HasPrimaryImage
{
get { return PrimaryImageTag.HasValue; }
}
/// <summary>
/// Gets a value indicating whether this instance has backdrop.
/// </summary>
/// <value><c>true</c> if this instance has backdrop; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool HasBackdrop
{
get { return BackdropImageTag.HasValue; }
}
}
}

View File

@@ -0,0 +1,32 @@
using ProtoBuf;
namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Class ChapterInfo
/// </summary>
[ProtoContract]
public class ChapterInfo
{
/// <summary>
/// Gets or sets the start position ticks.
/// </summary>
/// <value>The start position ticks.</value>
[ProtoMember(1)]
public long StartPositionTicks { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(2)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the image path.
/// </summary>
/// <value>The image path.</value>
[ProtoMember(3)]
public string ImagePath { get; set; }
}
}

View File

@@ -0,0 +1,182 @@
using MediaBrowser.Model.Drawing;
using ProtoBuf;
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Defines the display preferences for any item that supports them (usually Folders)
/// </summary>
[ProtoContract]
public class DisplayPreferences
{
/// <summary>
/// The image scale
/// </summary>
private const double ImageScale = .9;
/// <summary>
/// Initializes a new instance of the <see cref="DisplayPreferences" /> class.
/// </summary>
public DisplayPreferences()
{
ViewType = ViewTypes.Poster;
PrimaryImageType = ImageType.Primary;
RememberIndexing = false;
PrimaryImageHeight = 250;
PrimaryImageWidth = 250;
CustomPrefs = new Dictionary<string, string>();
}
/// <summary>
/// Gets or sets the user id.
/// </summary>
/// <value>The user id.</value>
[ProtoMember(1)]
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the type of the view.
/// </summary>
/// <value>The type of the view.</value>
[ProtoMember(2)]
public ViewTypes ViewType { get; set; }
/// <summary>
/// Gets or sets the type of the primary image.
/// </summary>
/// <value>The type of the primary image.</value>
[ProtoMember(3)]
public ImageType PrimaryImageType { get; set; }
/// <summary>
/// Gets or sets the sort by.
/// </summary>
/// <value>The sort by.</value>
[ProtoMember(4)]
public string SortBy { get; set; }
/// <summary>
/// Gets or sets the index by.
/// </summary>
/// <value>The index by.</value>
[ProtoMember(5)]
public string IndexBy { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [remember indexing].
/// </summary>
/// <value><c>true</c> if [remember indexing]; otherwise, <c>false</c>.</value>
[ProtoMember(6)]
public bool RememberIndexing { get; set; }
/// <summary>
/// Gets or sets the height of the primary image.
/// </summary>
/// <value>The height of the primary image.</value>
[ProtoMember(7)]
public int PrimaryImageHeight { get; set; }
/// <summary>
/// Gets or sets the width of the primary image.
/// </summary>
/// <value>The width of the primary image.</value>
[ProtoMember(8)]
public int PrimaryImageWidth { get; set; }
/// <summary>
/// Gets or sets the custom prefs.
/// </summary>
/// <value>The custom prefs.</value>
[ProtoMember(9)]
public Dictionary<string, string> CustomPrefs { get; set; }
/// <summary>
/// Gets or sets the scroll direction.
/// </summary>
/// <value>The scroll direction.</value>
[ProtoMember(10)]
public ScrollDirection ScrollDirection { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [remember sorting].
/// </summary>
/// <value><c>true</c> if [remember sorting]; otherwise, <c>false</c>.</value>
[ProtoMember(11)]
public bool RememberSorting { get; set; }
/// <summary>
/// Gets or sets the sort order.
/// </summary>
/// <value>The sort order.</value>
[ProtoMember(12)]
public SortOrder SortOrder { get; set; }
/// <summary>
/// Increases the size of the image.
/// </summary>
public void IncreaseImageSize()
{
var newWidth = PrimaryImageWidth / ImageScale;
var size = DrawingUtils.Resize(PrimaryImageWidth, PrimaryImageHeight, newWidth);
PrimaryImageWidth = Convert.ToInt32(size.Width);
PrimaryImageHeight = Convert.ToInt32(size.Height);
}
/// <summary>
/// Decreases the size of the image.
/// </summary>
public void DecreaseImageSize()
{
var size = DrawingUtils.Scale(PrimaryImageWidth, PrimaryImageHeight, ImageScale);
PrimaryImageWidth = Convert.ToInt32(size.Width);
PrimaryImageHeight = Convert.ToInt32(size.Height);
}
}
/// <summary>
/// Enum ViewTypes
/// </summary>
public enum ViewTypes
{
/// <summary>
/// The poster
/// </summary>
Poster,
/// <summary>
/// The cover flow
/// </summary>
CoverFlow,
/// <summary>
/// The thumb strip
/// </summary>
ThumbStrip,
/// <summary>
/// The list
/// </summary>
List
}
/// <summary>
/// Enum ScrollDirection
/// </summary>
public enum ScrollDirection
{
/// <summary>
/// The horizontal
/// </summary>
Horizontal,
/// <summary>
/// The vertical
/// </summary>
Vertical
}
/// <summary>
/// Enum SortOrder
/// </summary>
public enum SortOrder
{
/// <summary>
/// The ascending
/// </summary>
Ascending,
/// <summary>
/// The descending
/// </summary>
Descending
}
}

View File

@@ -0,0 +1,12 @@
using System.Collections.Generic;
namespace MediaBrowser.Model.Entities
{
/// <summary>
/// This is essentially a marker interface
/// </summary>
public interface IHasMediaStreams
{
List<MediaStream> MediaStreams { get; set; }
}
}

View File

@@ -1,57 +1,94 @@
using System.Collections.Generic;
namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Since BaseItem and DTOBaseItem both have ProviderIds, this interface helps avoid code repition by using extension methods
/// </summary>
public interface IHasProviderIds
{
Dictionary<string, string> ProviderIds { get; set; }
}
public static class ProviderIdsExtensions
{
/// <summary>
/// Gets a provider id
/// </summary>
public static string GetProviderId(this IHasProviderIds instance, MetadataProviders provider)
{
return instance.GetProviderId(provider.ToString());
}
/// <summary>
/// Gets a provider id
/// </summary>
public static string GetProviderId(this IHasProviderIds instance, string name)
{
if (instance.ProviderIds == null)
{
return null;
}
return instance.ProviderIds[name];
}
/// <summary>
/// Sets a provider id
/// </summary>
public static void SetProviderId(this IHasProviderIds instance, string name, string value)
{
if (instance.ProviderIds == null)
{
instance.ProviderIds = new Dictionary<string, string>();
}
instance.ProviderIds[name] = value;
}
/// <summary>
/// Sets a provider id
/// </summary>
public static void SetProviderId(this IHasProviderIds instance, MetadataProviders provider, string value)
{
instance.SetProviderId(provider.ToString(), value);
}
}
}
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Since BaseItem and DTOBaseItem both have ProviderIds, this interface helps avoid code repition by using extension methods
/// </summary>
public interface IHasProviderIds
{
/// <summary>
/// Gets or sets the provider ids.
/// </summary>
/// <value>The provider ids.</value>
Dictionary<string, string> ProviderIds { get; set; }
}
/// <summary>
/// Class ProviderIdsExtensions
/// </summary>
public static class ProviderIdsExtensions
{
/// <summary>
/// Gets a provider id
/// </summary>
/// <param name="instance">The instance.</param>
/// <param name="provider">The provider.</param>
/// <returns>System.String.</returns>
public static string GetProviderId(this IHasProviderIds instance, MetadataProviders provider)
{
return instance.GetProviderId(provider.ToString());
}
/// <summary>
/// Gets a provider id
/// </summary>
/// <param name="instance">The instance.</param>
/// <param name="name">The name.</param>
/// <returns>System.String.</returns>
public static string GetProviderId(this IHasProviderIds instance, string name)
{
if (instance.ProviderIds == null)
{
return null;
}
string id;
instance.ProviderIds.TryGetValue(name, out id);
return id;
}
/// <summary>
/// Sets a provider id
/// </summary>
/// <param name="instance">The instance.</param>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
public static void SetProviderId(this IHasProviderIds instance, string name, string value)
{
// If it's null remove the key from the dictionary
if (string.IsNullOrEmpty(value))
{
if (instance.ProviderIds != null)
{
if (instance.ProviderIds.ContainsKey(name))
{
instance.ProviderIds.Remove(name);
}
}
}
else
{
// Ensure it exists
if (instance.ProviderIds == null)
{
instance.ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
instance.ProviderIds[name] = value;
}
}
/// <summary>
/// Sets a provider id
/// </summary>
/// <param name="instance">The instance.</param>
/// <param name="provider">The provider.</param>
/// <param name="value">The value.</param>
public static void SetProviderId(this IHasProviderIds instance, MetadataProviders provider, string value)
{
instance.SetProviderId(provider.ToString(), value);
}
}
}

View File

@@ -1,13 +1,54 @@

namespace MediaBrowser.Model.Entities
{
public enum ImageType
{
Primary,
Art,
Backdrop,
Banner,
Logo,
Thumbnail
}
}

namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Enum ImageType
/// </summary>
public enum ImageType
{
/// <summary>
/// The primary
/// </summary>
Primary,
/// <summary>
/// The art
/// </summary>
Art,
/// <summary>
/// The backdrop
/// </summary>
Backdrop,
/// <summary>
/// The banner
/// </summary>
Banner,
/// <summary>
/// The logo
/// </summary>
Logo,
/// <summary>
/// The thumb
/// </summary>
Thumb,
/// <summary>
/// The disc
/// </summary>
Disc,
/// <summary>
/// The box
/// </summary>
Box,
/// <summary>
/// The screenshot
/// </summary>
Screenshot,
/// <summary>
/// The menu
/// </summary>
Menu,
/// <summary>
/// The chapter image
/// </summary>
ChapterImage
}
}

View File

@@ -1,23 +0,0 @@
using ProtoBuf;
namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Since it can be slow to collect this data, this class helps provide a way to calculate them all at once.
/// </summary>
[ProtoContract]
public class ItemSpecialCounts
{
[ProtoMember(1)]
public int RecentlyAddedItemCount { get; set; }
[ProtoMember(2)]
public int RecentlyAddedUnPlayedItemCount { get; set; }
[ProtoMember(3)]
public int InProgressItemCount { get; set; }
[ProtoMember(4)]
public decimal PlayedPercentage { get; set; }
}
}

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Class LibraryUpdateInfo
/// </summary>
public class LibraryUpdateInfo
{
/// <summary>
/// Gets or sets the folder.
/// </summary>
/// <value>The folder.</value>
public BaseItemInfo Folder { get; set; }
/// <summary>
/// Gets or sets the items added.
/// </summary>
/// <value>The items added.</value>
public IEnumerable<BaseItemInfo> ItemsAdded { get; set; }
/// <summary>
/// Gets or sets the items removed.
/// </summary>
/// <value>The items removed.</value>
public IEnumerable<Guid> ItemsRemoved { get; set; }
/// <summary>
/// Gets or sets the items updated.
/// </summary>
/// <value>The items updated.</value>
public IEnumerable<Guid> ItemsUpdated { get; set; }
}
}

View File

@@ -0,0 +1,22 @@

namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Enum LocationType
/// </summary>
public enum LocationType
{
/// <summary>
/// The file system
/// </summary>
FileSystem,
/// <summary>
/// The remote
/// </summary>
Remote,
/// <summary>
/// The virtual
/// </summary>
Virtual
}
}

View File

@@ -0,0 +1,29 @@
using System;
namespace Mediabrowser.Model.Entities
{
public class MBRegistrationRecord
{
public DateTime ExpirationDate = DateTime.MinValue;
public bool IsRegistered = false;
public bool RegChecked = false;
public bool RegError = false;
private bool? _isInTrial;
public bool TrialVersion
{
get
{
if (_isInTrial == null)
{
if (!RegChecked) return false; //don't set this until we've successfully obtained exp date
_isInTrial = ExpirationDate > DateTime.Now;
}
return (_isInTrial.Value && !IsRegistered);
}
}
public bool IsValid
{
get { return !RegChecked || (IsRegistered || TrialVersion); }
}
}
}

View File

@@ -0,0 +1,156 @@
using ProtoBuf;
namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Class MediaStream
/// </summary>
[ProtoContract]
public class MediaStream
{
/// <summary>
/// Gets or sets the codec.
/// </summary>
/// <value>The codec.</value>
[ProtoMember(1)]
public string Codec { get; set; }
/// <summary>
/// Gets or sets the language.
/// </summary>
/// <value>The language.</value>
[ProtoMember(2)]
public string Language { get; set; }
/// <summary>
/// Gets or sets the bit rate.
/// </summary>
/// <value>The bit rate.</value>
[ProtoMember(3)]
public int? BitRate { get; set; }
/// <summary>
/// Gets or sets the channels.
/// </summary>
/// <value>The channels.</value>
[ProtoMember(4)]
public int? Channels { get; set; }
/// <summary>
/// Gets or sets the sample rate.
/// </summary>
/// <value>The sample rate.</value>
[ProtoMember(5)]
public int? SampleRate { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is default.
/// </summary>
/// <value><c>true</c> if this instance is default; otherwise, <c>false</c>.</value>
[ProtoMember(6)]
public bool IsDefault { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is forced.
/// </summary>
/// <value><c>true</c> if this instance is forced; otherwise, <c>false</c>.</value>
[ProtoMember(7)]
public bool IsForced { get; set; }
/// <summary>
/// Gets or sets the height.
/// </summary>
/// <value>The height.</value>
[ProtoMember(8)]
public int? Height { get; set; }
/// <summary>
/// Gets or sets the width.
/// </summary>
/// <value>The width.</value>
[ProtoMember(9)]
public int? Width { get; set; }
/// <summary>
/// Gets or sets the type of the scan.
/// </summary>
/// <value>The type of the scan.</value>
[ProtoMember(10)]
public string ScanType { get; set; }
/// <summary>
/// Gets or sets the average frame rate.
/// </summary>
/// <value>The average frame rate.</value>
[ProtoMember(11)]
public float? AverageFrameRate { get; set; }
/// <summary>
/// Gets or sets the real frame rate.
/// </summary>
/// <value>The real frame rate.</value>
[ProtoMember(12)]
public float? RealFrameRate { get; set; }
/// <summary>
/// Gets or sets the profile.
/// </summary>
/// <value>The profile.</value>
[ProtoMember(13)]
public string Profile { get; set; }
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
[ProtoMember(14)]
public MediaStreamType Type { get; set; }
/// <summary>
/// Gets or sets the aspect ratio.
/// </summary>
/// <value>The aspect ratio.</value>
[ProtoMember(15)]
public string AspectRatio { get; set; }
/// <summary>
/// Gets or sets the index.
/// </summary>
/// <value>The index.</value>
[ProtoMember(16)]
public int Index { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is external.
/// </summary>
/// <value><c>true</c> if this instance is external; otherwise, <c>false</c>.</value>
[ProtoMember(17)]
public bool IsExternal { get; set; }
/// <summary>
/// Gets or sets the filename.
/// </summary>
/// <value>The filename.</value>
[ProtoMember(18)]
public string Path { get; set; }
}
/// <summary>
/// Enum MediaStreamType
/// </summary>
public enum MediaStreamType
{
/// <summary>
/// The audio
/// </summary>
Audio,
/// <summary>
/// The video
/// </summary>
Video,
/// <summary>
/// The subtitle
/// </summary>
Subtitle
}
}

View File

@@ -0,0 +1,22 @@

namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Class MediaType
/// </summary>
public class MediaType
{
/// <summary>
/// The video
/// </summary>
public const string Video = "Video";
/// <summary>
/// The audio
/// </summary>
public const string Audio = "Audio";
/// <summary>
/// The game
/// </summary>
public const string Game = "Game";
}
}

View File

@@ -1,11 +1,26 @@

namespace MediaBrowser.Model.Entities
{
public enum MetadataProviders
{
Imdb,
Tmdb,
Tvdb,
Tvcom
}
}

namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Enum MetadataProviders
/// </summary>
public enum MetadataProviders
{
/// <summary>
/// The imdb
/// </summary>
Imdb,
/// <summary>
/// The TMDB
/// </summary>
Tmdb,
/// <summary>
/// The TVDB
/// </summary>
Tvdb,
/// <summary>
/// The tvcom
/// </summary>
Tvcom
}
}

View File

@@ -0,0 +1,25 @@
using ProtoBuf;
namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Class ParentalRating
/// </summary>
[ProtoContract]
public class ParentalRating
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(1)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the value.
/// </summary>
/// <value>The value.</value>
[ProtoMember(2)]
public int Value { get; set; }
}
}

View File

@@ -0,0 +1,30 @@

namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Struct PersonType
/// </summary>
public class PersonType
{
/// <summary>
/// The actor
/// </summary>
public const string Actor = "Actor";
/// <summary>
/// The director
/// </summary>
public const string Director = "Director";
/// <summary>
/// The composer
/// </summary>
public const string Composer = "Composer";
/// <summary>
/// The writer
/// </summary>
public const string Writer = "Writer";
/// <summary>
/// The music artist
/// </summary>
public const string MusicArtist = "MusicArtist";
}
}

View File

@@ -0,0 +1,32 @@
using ProtoBuf;
namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Class PluginSecurityInfo
/// </summary>
[ProtoContract]
public class PluginSecurityInfo
{
/// <summary>
/// Gets or sets the supporter key.
/// </summary>
/// <value>The supporter key.</value>
[ProtoMember(1)]
public string SupporterKey { get; set; }
/// <summary>
/// Gets or sets the legacy supporter key.
/// </summary>
/// <value><c>The legacy supporter key</value>
[ProtoMember(2)]
public string LegacyKey { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is MB supporter.
/// </summary>
/// <value><c>true</c> if this instance is MB supporter; otherwise, <c>false</c>.</value>
[ProtoMember(3)]
public bool IsMBSupporter { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
using ProtoBuf;
namespace MediaBrowser.Model.Entities
{
[ProtoContract]
public class EmptyRequestResult
{
}
}

View File

@@ -0,0 +1,18 @@

namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Enum SeriesStatus
/// </summary>
public enum SeriesStatus
{
/// <summary>
/// The continuing
/// </summary>
Continuing,
/// <summary>
/// The ended
/// </summary>
Ended
}
}

View File

@@ -1,17 +0,0 @@
using ProtoBuf;
namespace MediaBrowser.Model.Entities
{
[ProtoContract]
public class SubtitleStream
{
[ProtoMember(1)]
public string Language { get; set; }
[ProtoMember(2)]
public bool IsDefault { get; set; }
[ProtoMember(3)]
public bool IsForced { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
namespace MediaBrowser.Model.Entities
{
public enum VideoFormat
{
Standard,
Digital3D,
Sbs3D
}
}

View File

@@ -1,12 +1,45 @@

namespace MediaBrowser.Model.Entities
{
public enum VideoType
{
VideoFile,
Iso,
Dvd,
BluRay,
HdDvd
}
}

namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Enum VideoType
/// </summary>
public enum VideoType
{
/// <summary>
/// The video file
/// </summary>
VideoFile,
/// <summary>
/// The iso
/// </summary>
Iso,
/// <summary>
/// The DVD
/// </summary>
Dvd,
/// <summary>
/// The blu ray
/// </summary>
BluRay,
/// <summary>
/// The hd DVD
/// </summary>
HdDvd
}
/// <summary>
/// Enum IsoType
/// </summary>
public enum IsoType
{
/// <summary>
/// The DVD
/// </summary>
Dvd,
/// <summary>
/// The blu ray
/// </summary>
BluRay
}
}

View File

@@ -0,0 +1,26 @@
using ProtoBuf;
using System.Collections.Generic;
namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Used to hold information about a user's list of configured virtual folders
/// </summary>
[ProtoContract]
public class VirtualFolderInfo
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(1)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the locations.
/// </summary>
/// <value>The locations.</value>
[ProtoMember(2)]
public List<string> Locations { get; set; }
}
}

View File

@@ -0,0 +1,20 @@

namespace MediaBrowser.Model.Extensions
{
/// <summary>
/// Class ModelExtensions
/// </summary>
static class ModelExtensions
{
/// <summary>
/// Values the or default.
/// </summary>
/// <param name="str">The STR.</param>
/// <param name="def">The def.</param>
/// <returns>System.String.</returns>
public static string ValueOrDefault(this string str, string def = "")
{
return string.IsNullOrEmpty(str) ? def : str;
}
}
}

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<PropertyChanged />
</Weavers>

View File

@@ -0,0 +1,39 @@
using ProtoBuf;
namespace MediaBrowser.Model.Globalization
{
/// <summary>
/// Class CountryInfo
/// </summary>
[ProtoContract]
public class CountryInfo
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(1)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the display name.
/// </summary>
/// <value>The display name.</value>
[ProtoMember(2)]
public string DisplayName { get; set; }
/// <summary>
/// Gets or sets the name of the two letter ISO region.
/// </summary>
/// <value>The name of the two letter ISO region.</value>
[ProtoMember(3)]
public string TwoLetterISORegionName { get; set; }
/// <summary>
/// Gets or sets the name of the three letter ISO region.
/// </summary>
/// <value>The name of the three letter ISO region.</value>
[ProtoMember(4)]
public string ThreeLetterISORegionName { get; set; }
}
}

View File

@@ -0,0 +1,39 @@
using ProtoBuf;
namespace MediaBrowser.Model.Globalization
{
/// <summary>
/// Class CultureDto
/// </summary>
[ProtoContract]
public class CultureDto
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(1)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the display name.
/// </summary>
/// <value>The display name.</value>
[ProtoMember(2)]
public string DisplayName { get; set; }
/// <summary>
/// Gets or sets the name of the two letter ISO language.
/// </summary>
/// <value>The name of the two letter ISO language.</value>
[ProtoMember(3)]
public string TwoLetterISOLanguageName { get; set; }
/// <summary>
/// Gets or sets the name of the three letter ISO language.
/// </summary>
/// <value>The name of the three letter ISO language.</value>
[ProtoMember(4)]
public string ThreeLetterISOLanguageName { get; set; }
}
}

View File

@@ -0,0 +1,55 @@
using ProtoBuf;
namespace MediaBrowser.Model.IO
{
/// <summary>
/// Class FileSystemEntryInfo
/// </summary>
[ProtoContract]
public class FileSystemEntryInfo
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(1)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the path.
/// </summary>
/// <value>The path.</value>
[ProtoMember(2)]
public string Path { get; set; }
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
[ProtoMember(3)]
public FileSystemEntryType Type { get; set; }
}
/// <summary>
/// Enum FileSystemEntryType
/// </summary>
public enum FileSystemEntryType
{
/// <summary>
/// The file
/// </summary>
File,
/// <summary>
/// The directory
/// </summary>
Directory,
/// <summary>
/// The network computer
/// </summary>
NetworkComputer,
/// <summary>
/// The network share
/// </summary>
NetworkShare
}
}

View File

@@ -0,0 +1,78 @@
using System;
using System.Text;
namespace MediaBrowser.Model.Logging
{
/// <summary>
/// Interface ILogger
/// </summary>
public interface ILogger
{
/// <summary>
/// Infoes the specified message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="paramList">The param list.</param>
void Info(string message, params object[] paramList);
/// <summary>
/// Errors the specified message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="paramList">The param list.</param>
void Error(string message, params object[] paramList);
/// <summary>
/// Warns the specified message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="paramList">The param list.</param>
void Warn(string message, params object[] paramList);
/// <summary>
/// Debugs the specified message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="paramList">The param list.</param>
void Debug(string message, params object[] paramList);
/// <summary>
/// Fatals the specified message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="paramList">The param list.</param>
void Fatal(string message, params object[] paramList);
/// <summary>
/// Fatals the exception.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="exception">The exception.</param>
/// <param name="paramList">The param list.</param>
void FatalException(string message, Exception exception, params object[] paramList);
/// <summary>
/// Logs the specified severity.
/// </summary>
/// <param name="severity">The severity.</param>
/// <param name="message">The message.</param>
/// <param name="paramList">The param list.</param>
void Log(LogSeverity severity, string message, params object[] paramList);
/// <summary>
/// Logs the exception.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="exception">The exception.</param>
/// <param name="paramList">The param list.</param>
void ErrorException(string message, Exception exception, params object[] paramList);
/// <summary>
/// Logs the multiline.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="severity">The severity.</param>
/// <param name="additionalContent">Content of the additional.</param>
void LogMultiline(string message, LogSeverity severity, StringBuilder additionalContent);
}
}

View File

@@ -0,0 +1,30 @@

namespace MediaBrowser.Model.Logging
{
/// <summary>
/// Enum LogSeverity
/// </summary>
public enum LogSeverity
{
/// <summary>
/// The info
/// </summary>
Info,
/// <summary>
/// The debug
/// </summary>
Debug,
/// <summary>
/// The warn
/// </summary>
Warn,
/// <summary>
/// The error
/// </summary>
Error,
/// <summary>
/// The fatal
/// </summary>
Fatal
}
}

View File

@@ -1,80 +1,134 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MediaBrowser.Model</RootNamespace>
<AssemblyName>MediaBrowser.Model</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile4</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="Configuration\BaseApplicationConfiguration.cs" />
<Compile Include="Configuration\ServerConfiguration.cs" />
<Compile Include="DTO\AudioInfo.cs" />
<Compile Include="DTO\AudioOutputFormats.cs" />
<Compile Include="DTO\DtoUserItemData.cs" />
<Compile Include="DTO\MovieInfo.cs" />
<Compile Include="DTO\SeriesInfo.cs" />
<Compile Include="Authentication\AuthenticationResult.cs" />
<Compile Include="DTO\DtoBaseItem.cs" />
<Compile Include="DTO\DtoUser.cs" />
<Compile Include="DTO\VideoInfo.cs" />
<Compile Include="DTO\VideoOutputFormats.cs" />
<Compile Include="DTO\IbnItem.cs" />
<Compile Include="Entities\AudioStream.cs" />
<Compile Include="Entities\ImageType.cs" />
<Compile Include="Entities\IHasProviderIds.cs" />
<Compile Include="Entities\ItemSpecialCounts.cs" />
<Compile Include="Entities\MetadataProviders.cs" />
<Compile Include="Entities\SubtitleStream.cs" />
<Compile Include="Entities\VideoType.cs" />
<Compile Include="Plugins\BasePluginConfiguration.cs" />
<Compile Include="DTO\PluginInfo.cs" />
<Compile Include="Progress\TaskProgress.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Weather\WeatherForecast.cs" />
<Compile Include="Weather\WeatherInfo.cs" />
<Compile Include="Weather\WeatherStatus.cs" />
<Compile Include="Weather\WeatherUnits.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="protobuf-net">
<HintPath>..\protobuf-net\Full\portable\protobuf-net.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>"$(ProjectDir)..\protobuf-net\Precompile\precompile.exe" "$(TargetPath)" -o:"$(ProjectDir)bin\ProtobufModelSerializer.dll" -t:ProtobufModelSerializer</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MediaBrowser.Model</RootNamespace>
<AssemblyName>MediaBrowser.Model</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile4</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>Always</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Compile Include="Configuration\BaseApplicationConfiguration.cs" />
<Compile Include="Configuration\ServerConfiguration.cs" />
<Compile Include="DTO\BaseItemPerson.cs" />
<Compile Include="DTO\ChapterInfoDto.cs" />
<Compile Include="DTO\MediaType.cs" />
<Compile Include="Entities\BaseItemInfo.cs" />
<Compile Include="Connectivity\ClientConnectionInfo.cs" />
<Compile Include="Connectivity\ClientType.cs" />
<Compile Include="Entities\ChapterInfo.cs" />
<Compile Include="Entities\LocationType.cs" />
<Compile Include="Entities\MBRegistrationRecord.cs" />
<Compile Include="Entities\MediaType.cs" />
<Compile Include="Entities\PersonType.cs" />
<Compile Include="Entities\PluginSecurityInfo.cs" />
<Compile Include="Globalization\CountryInfo.cs" />
<Compile Include="Globalization\CultureDto.cs" />
<Compile Include="IO\FileSystemEntryInfo.cs" />
<Compile Include="DTO\ImageOptions.cs" />
<Compile Include="DTO\ItemFilter.cs" />
<Compile Include="DTO\ItemQuery.cs" />
<Compile Include="Entities\LibraryUpdateInfo.cs" />
<Compile Include="Entities\ParentalRating.cs" />
<Compile Include="DTO\StreamOptions.cs" />
<Compile Include="Entities\VirtualFolderInfo.cs" />
<Compile Include="Entities\IHasMediaStreams.cs" />
<Compile Include="Entities\VideoFormat.cs" />
<Compile Include="Extensions\ModelExtensions.cs" />
<Compile Include="Logging\ILogger.cs" />
<Compile Include="Logging\LogSeverity.cs" />
<Compile Include="Net\HttpException.cs" />
<Compile Include="Updates\InstallationInfo.cs" />
<Compile Include="Updates\PackageType.cs" />
<Compile Include="Updates\PackageVersionClass.cs" />
<Compile Include="Entities\RequestResult.cs" />
<Compile Include="Configuration\UserConfiguration.cs" />
<Compile Include="Drawing\DrawingUtils.cs" />
<Compile Include="DTO\DtoUserItemData.cs" />
<Compile Include="DTO\ItemFields.cs" />
<Compile Include="DTO\ItemSortBy.cs" />
<Compile Include="DTO\DtoBaseItem.cs" />
<Compile Include="DTO\DtoUser.cs" />
<Compile Include="DTO\ItemsResult.cs" />
<Compile Include="Entities\DisplayPreferences.cs" />
<Compile Include="Entities\ImageType.cs" />
<Compile Include="Entities\IHasProviderIds.cs" />
<Compile Include="Entities\MetadataProviders.cs" />
<Compile Include="Entities\SeriesStatus.cs" />
<Compile Include="Entities\MediaStream.cs" />
<Compile Include="Entities\VideoType.cs" />
<Compile Include="Plugins\BasePluginConfiguration.cs" />
<Compile Include="Plugins\PluginInfo.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="System\SystemInfo.cs" />
<Compile Include="Tasks\SystemEvent.cs" />
<Compile Include="Tasks\TaskCompletionStatus.cs" />
<Compile Include="Tasks\TaskResult.cs" />
<Compile Include="Tasks\TaskInfo.cs" />
<Compile Include="Tasks\TaskProgress.cs" />
<Compile Include="Tasks\TaskState.cs" />
<Compile Include="Tasks\TaskTriggerInfo.cs" />
<Compile Include="Updates\PackageInfo.cs" />
<Compile Include="Updates\PackageVersionInfo.cs" />
<Compile Include="Weather\WeatherForecast.cs" />
<Compile Include="Weather\WeatherInfo.cs" />
<Compile Include="Weather\WeatherStatus.cs" />
<Compile Include="Weather\WeatherUnits.cs" />
<Compile Include="Web\QueryStringDictionary.cs" />
<None Include="FodyWeavers.xml" />
</ItemGroup>
<ItemGroup>
<Reference Include="PropertyChanged">
<HintPath>..\packages\PropertyChanged.Fody.1.32.2.0\lib\portable-net4+sl4+wp7+win8\PropertyChanged.dll</HintPath>
</Reference>
<Reference Include="protobuf-net">
<HintPath>..\packages\protobuf-net.2.0.0.621\lib\portable-sl4+net40+wp7+windows8\protobuf-net.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<Import Project="$(ProjectDir)\..\Tools\Fody\Fody.targets" />
</Project>

View File

@@ -0,0 +1,43 @@
using System;
using System.Net;
namespace MediaBrowser.Model.Net
{
/// <summary>
/// Class HttpException
/// </summary>
public class HttpException : Exception
{
/// <summary>
/// Gets or sets the status code.
/// </summary>
/// <value>The status code.</value>
public HttpStatusCode? StatusCode { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is timed out.
/// </summary>
/// <value><c>true</c> if this instance is timed out; otherwise, <c>false</c>.</value>
public bool IsTimedOut { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="HttpException" /> class.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="innerException">The inner exception.</param>
public HttpException(string message, Exception innerException)
: base(message, innerException)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="HttpException" /> class.
/// </summary>
/// <param name="message">The message.</param>
public HttpException(string message)
: base(message)
{
}
}
}

View File

@@ -1,13 +1,32 @@

namespace MediaBrowser.Model.Plugins
{
public class BasePluginConfiguration
{
public bool Enabled { get; set; }
public BasePluginConfiguration()
{
Enabled = true;
}
}
}
using MediaBrowser.Model.Updates;
namespace MediaBrowser.Model.Plugins
{
/// <summary>
/// Class BasePluginConfiguration
/// </summary>
public class BasePluginConfiguration
{
/// <summary>
/// Whether or not this plug-in should be automatically updated when a
/// compatible new version is released
/// </summary>
/// <value><c>true</c> if [enable auto update]; otherwise, <c>false</c>.</value>
public bool EnableAutoUpdate { get; set; }
/// <summary>
/// The classification of updates to which to subscribe.
/// Options are: Dev, Beta or Release
/// </summary>
/// <value>The update class.</value>
public PackageVersionClass UpdateClass { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="BasePluginConfiguration" /> class.
/// </summary>
public BasePluginConfiguration()
{
EnableAutoUpdate = true;
}
}
}

View File

@@ -0,0 +1,99 @@
using MediaBrowser.Model.Updates;
using ProtoBuf;
using System;
namespace MediaBrowser.Model.Plugins
{
/// <summary>
/// This is a serializable stub class that is used by the api to provide information about installed plugins.
/// </summary>
[ProtoContract]
public class PluginInfo
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(1)]
public string Name { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [download to UI].
/// </summary>
/// <value><c>true</c> if [download to UI]; otherwise, <c>false</c>.</value>
[ProtoMember(2)]
public bool DownloadToUI { get; set; }
/// <summary>
/// Gets or sets the configuration date last modified.
/// </summary>
/// <value>The configuration date last modified.</value>
[ProtoMember(3)]
public DateTime ConfigurationDateLastModified { get; set; }
/// <summary>
/// Gets or sets the version.
/// </summary>
/// <value>The version.</value>
[ProtoMember(4)]
public string Version { get; set; }
/// <summary>
/// Gets or sets the name of the assembly file.
/// </summary>
/// <value>The name of the assembly file.</value>
[ProtoMember(5)]
public string AssemblyFileName { get; set; }
/// <summary>
/// Gets or sets the name of the configuration file.
/// </summary>
/// <value>The name of the configuration file.</value>
[ProtoMember(6)]
public string ConfigurationFileName { get; set; }
/// <summary>
/// Gets or sets the description.
/// </summary>
/// <value>The description.</value>
[ProtoMember(7)]
public string Description { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is core plugin.
/// </summary>
/// <value><c>true</c> if this instance is core plugin; otherwise, <c>false</c>.</value>
[ProtoMember(8)]
public bool IsCorePlugin { get; set; }
/// <summary>
/// Gets or sets the unique id.
/// </summary>
/// <value>The unique id.</value>
[ProtoMember(9)]
public Guid UniqueId { get; set; }
/// <summary>
/// Whether or not this plug-in should be automatically updated when a
/// compatible new version is released
/// </summary>
/// <value><c>true</c> if [enable auto update]; otherwise, <c>false</c>.</value>
[ProtoMember(10)]
public bool EnableAutoUpdate { get; set; }
/// <summary>
/// The classification of updates to which to subscribe.
/// Options are: Dev, Beta or Release
/// </summary>
/// <value>The update class.</value>
[ProtoMember(11)]
public PackageVersionClass UpdateClass { get; set; }
/// <summary>
/// Gets or sets the minimum required UI version.
/// </summary>
/// <value>The minimum required UI version.</value>
[ProtoMember(12)]
public string MinimumRequiredUIVersion { get; set; }
}
}

View File

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

namespace MediaBrowser.Model.Progress
{
/// <summary>
/// Represents a generic progress class that can be used with IProgress
/// </summary>
public class TaskProgress
{
/// <summary>
/// Gets or sets a description of the actions currently executing
/// </summary>
public string Description { get; set; }
/// <summary>
/// Gets or sets the current completion percentage
/// </summary>
public decimal? PercentComplete { get; set; }
}
}

View File

@@ -1,28 +1,27 @@
using System.Reflection;
using System.Resources;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MediaBrowser.Model")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MediaBrowser.Model")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection;
using System.Resources;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MediaBrowser.Model")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MediaBrowser.Model")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.9.*")]

View File

@@ -0,0 +1,67 @@
using MediaBrowser.Model.Updates;
using ProtoBuf;
namespace MediaBrowser.Model.System
{
/// <summary>
/// Class SystemInfo
/// </summary>
[ProtoContract]
public class SystemInfo
{
/// <summary>
/// Gets or sets the version.
/// </summary>
/// <value>The version.</value>
[ProtoMember(1)]
public string Version { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance has pending restart.
/// </summary>
/// <value><c>true</c> if this instance has pending restart; otherwise, <c>false</c>.</value>
[ProtoMember(2)]
public bool HasPendingRestart { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is network deployed.
/// </summary>
/// <value><c>true</c> if this instance is network deployed; otherwise, <c>false</c>.</value>
[ProtoMember(3)]
public bool IsNetworkDeployed { get; set; }
/// <summary>
/// Gets or sets the in progress installations.
/// </summary>
/// <value>The in progress installations.</value>
[ProtoMember(4)]
public InstallationInfo[] InProgressInstallations { get; set; }
/// <summary>
/// Gets or sets the web socket port number.
/// </summary>
/// <value>The web socket port number.</value>
[ProtoMember(5)]
public int WebSocketPortNumber { get; set; }
/// <summary>
/// Gets or sets the completed installations.
/// </summary>
/// <value>The completed installations.</value>
[ProtoMember(6)]
public InstallationInfo[] CompletedInstallations { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [supports native web socket].
/// </summary>
/// <value><c>true</c> if [supports native web socket]; otherwise, <c>false</c>.</value>
[ProtoMember(7)]
public bool SupportsNativeWebSocket { get; set; }
/// <summary>
/// Gets or sets plugin assemblies that failed to load.
/// </summary>
/// <value>The failed assembly loads.</value>
public string[] FailedPluginAssemblies { get; set; }
}
}

View File

@@ -0,0 +1,14 @@

namespace MediaBrowser.Model.Tasks
{
/// <summary>
/// Enum SystemEvent
/// </summary>
public enum SystemEvent
{
/// <summary>
/// The wake from sleep
/// </summary>
WakeFromSleep
}
}

View File

@@ -0,0 +1,29 @@

namespace MediaBrowser.Model.Tasks
{
/// <summary>
/// Enum TaskCompletionStatus
/// </summary>
public enum TaskCompletionStatus
{
/// <summary>
/// The completed
/// </summary>
Completed,
/// <summary>
/// The failed
/// </summary>
Failed,
/// <summary>
/// Manually cancelled by the user
/// </summary>
Cancelled,
/// <summary>
/// Aborted due to a system failure or shutdown
/// </summary>
Aborted
}
}

View File

@@ -0,0 +1,68 @@
using ProtoBuf;
using System;
namespace MediaBrowser.Model.Tasks
{
/// <summary>
/// Class TaskInfo
/// </summary>
[ProtoContract]
public class TaskInfo
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(1)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the state of the task.
/// </summary>
/// <value>The state of the task.</value>
[ProtoMember(2)]
public TaskState State { get; set; }
/// <summary>
/// Gets or sets the progress.
/// </summary>
/// <value>The progress.</value>
[ProtoMember(3)]
public TaskProgress CurrentProgress { get; set; }
/// <summary>
/// Gets or sets the id.
/// </summary>
/// <value>The id.</value>
[ProtoMember(4)]
public Guid Id { get; set; }
/// <summary>
/// Gets or sets the last execution result.
/// </summary>
/// <value>The last execution result.</value>
[ProtoMember(5)]
public TaskResult LastExecutionResult { get; set; }
/// <summary>
/// Gets or sets the triggers.
/// </summary>
/// <value>The triggers.</value>
[ProtoMember(6)]
public TaskTriggerInfo[] Triggers { get; set; }
/// <summary>
/// Gets or sets the description.
/// </summary>
/// <value>The description.</value>
[ProtoMember(7)]
public string Description { get; set; }
/// <summary>
/// Gets or sets the category.
/// </summary>
/// <value>The category.</value>
[ProtoMember(8)]
public string Category { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
using ProtoBuf;
namespace MediaBrowser.Model.Tasks
{
[ProtoContract]
public class TaskProgress
{
/// <summary>
/// Gets or sets the description.
/// </summary>
/// <value>The description.</value>
[ProtoMember(1)]
public string Description { get; set; }
/// <summary>
/// Gets or sets the percent complete.
/// </summary>
/// <value>The percent complete.</value>
[ProtoMember(2)]
public double PercentComplete { get; set; }
}
}

View File

@@ -0,0 +1,47 @@
using ProtoBuf;
using System;
namespace MediaBrowser.Model.Tasks
{
/// <summary>
/// Class TaskExecutionInfo
/// </summary>
[ProtoContract]
public class TaskResult
{
/// <summary>
/// Gets or sets the start time UTC.
/// </summary>
/// <value>The start time UTC.</value>
[ProtoMember(1)]
public DateTime StartTimeUtc { get; set; }
/// <summary>
/// Gets or sets the end time UTC.
/// </summary>
/// <value>The end time UTC.</value>
[ProtoMember(2)]
public DateTime EndTimeUtc { get; set; }
/// <summary>
/// Gets or sets the status.
/// </summary>
/// <value>The status.</value>
[ProtoMember(3)]
public TaskCompletionStatus Status { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(4)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the id.
/// </summary>
/// <value>The id.</value>
[ProtoMember(5)]
public Guid Id { get; set; }
}
}

View File

@@ -0,0 +1,22 @@

namespace MediaBrowser.Model.Tasks
{
/// <summary>
/// Enum TaskState
/// </summary>
public enum TaskState
{
/// <summary>
/// The idle
/// </summary>
Idle,
/// <summary>
/// The cancelling
/// </summary>
Cancelling,
/// <summary>
/// The running
/// </summary>
Running
}
}

View File

@@ -0,0 +1,47 @@
using ProtoBuf;
using System;
namespace MediaBrowser.Model.Tasks
{
/// <summary>
/// Class TaskTriggerInfo
/// </summary>
[ProtoContract]
public class TaskTriggerInfo
{
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
[ProtoMember(1)]
public string Type { get; set; }
/// <summary>
/// Gets or sets the time of day.
/// </summary>
/// <value>The time of day.</value>
[ProtoMember(2)]
public long? TimeOfDayTicks { get; set; }
/// <summary>
/// Gets or sets the interval.
/// </summary>
/// <value>The interval.</value>
[ProtoMember(3)]
public long? IntervalTicks { get; set; }
/// <summary>
/// Gets or sets the system event.
/// </summary>
/// <value>The system event.</value>
[ProtoMember(4)]
public SystemEvent? SystemEvent { get; set; }
/// <summary>
/// Gets or sets the day of week.
/// </summary>
/// <value>The day of week.</value>
[ProtoMember(5)]
public DayOfWeek? DayOfWeek { get; set; }
}
}

View File

@@ -0,0 +1,47 @@
using ProtoBuf;
using System;
namespace MediaBrowser.Model.Updates
{
/// <summary>
/// Class InstallationInfo
/// </summary>
[ProtoContract]
public class InstallationInfo
{
/// <summary>
/// Gets or sets the id.
/// </summary>
/// <value>The id.</value>
[ProtoMember(1)]
public Guid Id { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(2)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the version.
/// </summary>
/// <value>The version.</value>
[ProtoMember(3)]
public string Version { get; set; }
/// <summary>
/// Gets or sets the update class.
/// </summary>
/// <value>The update class.</value>
[ProtoMember(4)]
public PackageVersionClass UpdateClass { get; set; }
/// <summary>
/// Gets or sets the percent complete.
/// </summary>
/// <value>The percent complete.</value>
[ProtoMember(5)]
public double? PercentComplete { get; set; }
}
}

View File

@@ -0,0 +1,139 @@
using System;
using ProtoBuf;
using System.Collections.Generic;
namespace MediaBrowser.Model.Updates
{
/// <summary>
/// Class PackageInfo
/// </summary>
[ProtoContract]
public class PackageInfo
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(1)]
public string name { get; set; }
/// <summary>
/// Gets or sets the short description.
/// </summary>
/// <value>The short description.</value>
[ProtoMember(2)]
public string shortDescription { get; set; }
/// <summary>
/// Gets or sets the overview.
/// </summary>
/// <value>The overview.</value>
[ProtoMember(3)]
public string overview { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is premium.
/// </summary>
/// <value><c>true</c> if this instance is premium; otherwise, <c>false</c>.</value>
[ProtoMember(4)]
public bool isPremium { get; set; }
/// <summary>
/// Gets or sets the rich desc URL.
/// </summary>
/// <value>The rich desc URL.</value>
[ProtoMember(5)]
public string richDescUrl { get; set; }
/// <summary>
/// Gets or sets the thumb image.
/// </summary>
/// <value>The thumb image.</value>
[ProtoMember(6)]
public string thumbImage { get; set; }
/// <summary>
/// Gets or sets the preview image.
/// </summary>
/// <value>The preview image.</value>
[ProtoMember(7)]
public string previewImage { get; set; }
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
[ProtoMember(8)]
public PackageType type { get; set; }
/// <summary>
/// Gets or sets the target filename.
/// </summary>
/// <value>The target filename.</value>
[ProtoMember(9)]
public string targetFilename { get; set; }
/// <summary>
/// Gets or sets the owner.
/// </summary>
/// <value>The owner.</value>
[ProtoMember(10)]
public string owner { get; set; }
/// <summary>
/// Gets or sets the category.
/// </summary>
/// <value>The category.</value>
[ProtoMember(11)]
public string category { get; set; }
/// <summary>
/// Gets or sets the catalog tile color.
/// </summary>
/// <value>The owner.</value>
[ProtoMember(12)]
public string tileColor { get; set; }
/// <summary>
/// Gets or sets the feature id of this package (if premium).
/// </summary>
/// <value>The feature id.</value>
[ProtoMember(13)]
public string featureId { get; set; }
/// <summary>
/// Gets or sets the registration info for this package (if premium).
/// </summary>
/// <value>The registration info.</value>
[ProtoMember(14)]
public string regInfo { get; set; }
/// <summary>
/// Gets or sets the price for this package (if premium).
/// </summary>
/// <value>The price.</value>
[ProtoMember(15)]
public float price { get; set; }
/// <summary>
/// Gets or sets whether or not this package is registered.
/// </summary>
/// <value>True if registered.</value>
[ProtoMember(16)]
public bool isRegistered { get; set; }
/// <summary>
/// Gets or sets the expiration date for this package.
/// </summary>
/// <value>Expiration Date.</value>
[ProtoMember(17)]
public DateTime expDate { get; set; }
/// <summary>
/// Gets or sets the versions.
/// </summary>
/// <value>The versions.</value>
[ProtoMember(18)]
public List<PackageVersionInfo> versions { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
namespace MediaBrowser.Model.Updates
{
/// <summary>
/// Enum PackageType
/// </summary>
public enum PackageType
{
/// <summary>
/// All
/// </summary>
All,
/// <summary>
/// The system
/// </summary>
System,
/// <summary>
/// The user installed
/// </summary>
UserInstalled
}
}

View File

@@ -0,0 +1,21 @@
namespace MediaBrowser.Model.Updates
{
/// <summary>
/// Enum PackageVersionClass
/// </summary>
public enum PackageVersionClass
{
/// <summary>
/// The release
/// </summary>
Release = 0,
/// <summary>
/// The beta
/// </summary>
Beta = 1,
/// <summary>
/// The dev
/// </summary>
Dev = 2
}
}

View File

@@ -0,0 +1,85 @@
using MediaBrowser.Model.Extensions;
using ProtoBuf;
using System;
using System.Runtime.Serialization;
namespace MediaBrowser.Model.Updates
{
/// <summary>
/// Class PackageVersionInfo
/// </summary>
[ProtoContract]
public class PackageVersionInfo
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ProtoMember(1)]
public string name { get; set; }
/// <summary>
/// Gets or sets the version STR.
/// </summary>
/// <value>The version STR.</value>
[ProtoMember(2)]
public string versionStr { get; set; }
/// <summary>
/// The _version
/// </summary>
private Version _version;
/// <summary>
/// Gets or sets the version.
/// Had to make this an interpreted property since Protobuf can't handle Version
/// </summary>
/// <value>The version.</value>
[IgnoreDataMember]
public Version version
{
get { return _version ?? (_version = new Version(versionStr.ValueOrDefault("0.0.0.1"))); }
}
/// <summary>
/// Gets or sets the classification.
/// </summary>
/// <value>The classification.</value>
[ProtoMember(4)]
public PackageVersionClass classification { get; set; }
/// <summary>
/// Gets or sets the description.
/// </summary>
/// <value>The description.</value>
[ProtoMember(5)]
public string description { get; set; }
/// <summary>
/// Gets or sets the required version STR.
/// </summary>
/// <value>The required version STR.</value>
[ProtoMember(6)]
public string requiredVersionStr { get; set; }
/// <summary>
/// Gets or sets the source URL.
/// </summary>
/// <value>The source URL.</value>
[ProtoMember(8)]
public string sourceUrl { get; set; }
/// <summary>
/// Gets or sets the source URL.
/// </summary>
/// <value>The source URL.</value>
[ProtoMember(9)]
public Guid checksum { get; set; }
/// <summary>
/// Gets or sets the target filename.
/// </summary>
/// <value>The target filename.</value>
[ProtoMember(10)]
public string targetFilename { get; set; }
}
}

View File

@@ -1,30 +1,54 @@
using System;
using ProtoBuf;
namespace MediaBrowser.Model.Weather
{
/// <summary>
/// Represents a weather forecase for a specific date
/// </summary>
[ProtoContract]
public class WeatherForecast
{
[ProtoMember(1)]
public DateTime Date { get; set; }
[ProtoMember(2)]
public int HighTemperatureFahrenheit { get; set; }
[ProtoMember(3)]
public int LowTemperatureFahrenheit { get; set; }
[ProtoMember(4)]
public int HighTemperatureCelsius { get; set; }
[ProtoMember(5)]
public int LowTemperatureCelsius { get; set; }
[ProtoMember(6)]
public WeatherConditions Condition { get; set; }
}
}
using System;
using ProtoBuf;
namespace MediaBrowser.Model.Weather
{
/// <summary>
/// Represents a weather forecast for a specific date
/// </summary>
[ProtoContract]
public class WeatherForecast
{
/// <summary>
/// Gets or sets the date.
/// </summary>
/// <value>The date.</value>
[ProtoMember(1)]
public DateTime Date { get; set; }
/// <summary>
/// Gets or sets the high temperature fahrenheit.
/// </summary>
/// <value>The high temperature fahrenheit.</value>
[ProtoMember(2)]
public int HighTemperatureFahrenheit { get; set; }
/// <summary>
/// Gets or sets the low temperature fahrenheit.
/// </summary>
/// <value>The low temperature fahrenheit.</value>
[ProtoMember(3)]
public int LowTemperatureFahrenheit { get; set; }
/// <summary>
/// Gets or sets the high temperature celsius.
/// </summary>
/// <value>The high temperature celsius.</value>
[ProtoMember(4)]
public int HighTemperatureCelsius { get; set; }
/// <summary>
/// Gets or sets the low temperature celsius.
/// </summary>
/// <value>The low temperature celsius.</value>
[ProtoMember(5)]
public int LowTemperatureCelsius { get; set; }
/// <summary>
/// Gets or sets the condition.
/// </summary>
/// <value>The condition.</value>
[ProtoMember(6)]
public WeatherConditions Condition { get; set; }
}
}

View File

@@ -1,14 +1,25 @@
using ProtoBuf;
namespace MediaBrowser.Model.Weather
{
[ProtoContract]
public class WeatherInfo
{
[ProtoMember(1)]
public WeatherStatus CurrentWeather { get; set; }
[ProtoMember(2)]
public WeatherForecast[] Forecasts { get; set; }
}
}
using ProtoBuf;
namespace MediaBrowser.Model.Weather
{
/// <summary>
/// Class WeatherInfo
/// </summary>
[ProtoContract]
public class WeatherInfo
{
/// <summary>
/// Gets or sets the current weather.
/// </summary>
/// <value>The current weather.</value>
[ProtoMember(1)]
public WeatherStatus CurrentWeather { get; set; }
/// <summary>
/// Gets or sets the forecasts.
/// </summary>
/// <value>The forecasts.</value>
[ProtoMember(2)]
public WeatherForecast[] Forecasts { get; set; }
}
}

View File

@@ -1,38 +1,90 @@
using ProtoBuf;
namespace MediaBrowser.Model.Weather
{
/// <summary>
/// Represents the current weather status
/// </summary>
[ProtoContract]
public class WeatherStatus
{
[ProtoMember(1)]
public int TemperatureFahrenheit { get; set; }
[ProtoMember(2)]
public int TemperatureCelsius { get; set; }
[ProtoMember(3)]
public int Humidity { get; set; }
[ProtoMember(4)]
public WeatherConditions Condition { get; set; }
}
public enum WeatherConditions
{
Sunny,
PartlyCloudy,
Cloudy,
Overcast,
Mist,
Snow,
Rain,
Sleet,
Fog,
Blizzard,
Thunderstorm
}
}
using ProtoBuf;
namespace MediaBrowser.Model.Weather
{
/// <summary>
/// Represents the current weather status
/// </summary>
[ProtoContract]
public class WeatherStatus
{
/// <summary>
/// Gets or sets the temperature fahrenheit.
/// </summary>
/// <value>The temperature fahrenheit.</value>
[ProtoMember(1)]
public int TemperatureFahrenheit { get; set; }
/// <summary>
/// Gets or sets the temperature celsius.
/// </summary>
/// <value>The temperature celsius.</value>
[ProtoMember(2)]
public int TemperatureCelsius { get; set; }
/// <summary>
/// Gets or sets the humidity.
/// </summary>
/// <value>The humidity.</value>
[ProtoMember(3)]
public int Humidity { get; set; }
/// <summary>
/// Gets or sets the condition.
/// </summary>
/// <value>The condition.</value>
[ProtoMember(4)]
public WeatherConditions Condition { get; set; }
}
/// <summary>
/// Enum WeatherConditions
/// </summary>
public enum WeatherConditions
{
/// <summary>
/// The sunny
/// </summary>
Sunny,
/// <summary>
/// The partly cloudy
/// </summary>
PartlyCloudy,
/// <summary>
/// The cloudy
/// </summary>
Cloudy,
/// <summary>
/// The overcast
/// </summary>
Overcast,
/// <summary>
/// The mist
/// </summary>
Mist,
/// <summary>
/// The snow
/// </summary>
Snow,
/// <summary>
/// The rain
/// </summary>
Rain,
/// <summary>
/// The sleet
/// </summary>
Sleet,
/// <summary>
/// The fog
/// </summary>
Fog,
/// <summary>
/// The blizzard
/// </summary>
Blizzard,
/// <summary>
/// The thunderstorm
/// </summary>
Thunderstorm
}
}

View File

@@ -1,9 +1,18 @@

namespace MediaBrowser.Model.Weather
{
public enum WeatherUnits
{
Fahrenheit,
Celsius
}
}

namespace MediaBrowser.Model.Weather
{
/// <summary>
/// Enum WeatherUnits
/// </summary>
public enum WeatherUnits
{
/// <summary>
/// The fahrenheit
/// </summary>
Fahrenheit,
/// <summary>
/// The celsius
/// </summary>
Celsius
}
}

View File

@@ -0,0 +1,265 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace MediaBrowser.Model.Web
{
/// <summary>
/// Class QueryStringDictionary
/// </summary>
public class QueryStringDictionary : Dictionary<string, string>
{
/// <summary>
/// Initializes a new instance of the <see cref="QueryStringDictionary" /> class.
/// </summary>
public QueryStringDictionary()
: base(StringComparer.OrdinalIgnoreCase)
{
}
/// <summary>
/// Adds the specified name.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
public void Add(string name, int value)
{
Add(name, value.ToString());
}
/// <summary>
/// Adds the specified name.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
public void Add(string name, long value)
{
Add(name, value.ToString());
}
/// <summary>
/// Adds the specified name.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
public void Add(string name, double value)
{
Add(name, value.ToString());
}
/// <summary>
/// Adds if not null or empty.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
public void AddIfNotNullOrEmpty(string name, string value)
{
if (!string.IsNullOrEmpty(value))
{
Add(name, value);
}
}
/// <summary>
/// Adds if not null.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
public void AddIfNotNull(string name, int? value)
{
if (value.HasValue)
{
Add(name, value.Value);
}
}
/// <summary>
/// Adds if not null.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
public void AddIfNotNull(string name, double? value)
{
if (value.HasValue)
{
Add(name, value.Value);
}
}
/// <summary>
/// Adds if not null.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
public void AddIfNotNull(string name, long? value)
{
if (value.HasValue)
{
Add(name, value.Value);
}
}
/// <summary>
/// Adds the specified name.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">if set to <c>true</c> [value].</param>
public void Add(string name, bool value)
{
Add(name, value.ToString());
}
/// <summary>
/// Adds if not null.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">if set to <c>true</c> [value].</param>
public void AddIfNotNull(string name, bool? value)
{
if (value.HasValue)
{
Add(name, value.Value);
}
}
/// <summary>
/// Adds the specified name.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
/// <exception cref="System.ArgumentNullException">value</exception>
public void Add(string name, Guid value)
{
if (value == Guid.Empty)
{
throw new ArgumentNullException("value");
}
Add(name, value.ToString());
}
/// <summary>
/// Adds if not empty.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
public void AddIfNotEmpty(string name, Guid value)
{
if (value != Guid.Empty)
{
Add(name, value);
}
Add(name, value);
}
/// <summary>
/// Adds if not null.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
public void AddIfNotNull(string name, Guid? value)
{
if (value.HasValue)
{
Add(name, value.Value);
}
}
/// <summary>
/// Adds the specified name.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
/// <exception cref="System.ArgumentNullException">value</exception>
public void Add(string name, IEnumerable<int> value)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
Add(name, string.Join(",", value.Select(v => v.ToString()).ToArray()));
}
/// <summary>
/// Adds if not null.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
public void AddIfNotNull(string name, IEnumerable<int> value)
{
if (value != null)
{
Add(name, value);
}
}
/// <summary>
/// Adds the specified name.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
/// <exception cref="System.ArgumentNullException">value</exception>
public void Add(string name, IEnumerable<string> value)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
Add(name, string.Join(",", value.Select(v => v.ToString()).ToArray()));
}
/// <summary>
/// Adds if not null.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
public void AddIfNotNull(string name, IEnumerable<string> value)
{
if (value != null)
{
Add(name, value);
}
}
/// <summary>
/// Gets the query string.
/// </summary>
/// <returns>System.String.</returns>
public string GetQueryString()
{
var queryParams = this.Select(i => string.Format("{0}={1}", i.Key, GetEncodedValue(i.Value))).ToArray();
return string.Join("&", queryParams);
}
/// <summary>
/// Gets the encoded value.
/// </summary>
/// <param name="value">The value.</param>
/// <returns>System.String.</returns>
private string GetEncodedValue(string value)
{
return value;
}
/// <summary>
/// Gets the URL.
/// </summary>
/// <param name="prefix">The prefix.</param>
/// <returns>System.String.</returns>
public string GetUrl(string prefix)
{
var query = GetQueryString();
if (string.IsNullOrEmpty(query))
{
return prefix;
}
return prefix + "?" + query;
}
}
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="PropertyChanged.Fody" version="1.32.2.0" targetFramework="portable-win+net45+sl40+wp" />
<package id="protobuf-net" version="2.0.0.621" targetFramework="portable-win+net45+sl40+wp" />
</packages>