diff options
| author | Luke <luke.pulverenti@gmail.com> | 2013-02-20 17:10:49 -0800 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2013-02-20 17:10:49 -0800 |
| commit | 845554722efaed872948a9e0f7202e3ef52f1b6e (patch) | |
| tree | 534ab2d11fe4824ed303bb01e885b330631b657e /MediaBrowser.Model | |
| parent | 2f142263f080f7b012a0ec2095d350ccf75b49b7 (diff) | |
| parent | 14bbb6804718ef78a8118fe750896ba679e3b6cb (diff) | |
Merge pull request #1 from MediaBrowser/Repo
Repo
Diffstat (limited to 'MediaBrowser.Model')
29 files changed, 900 insertions, 0 deletions
diff --git a/MediaBrowser.Model/Authentication/AuthenticationResult.cs b/MediaBrowser.Model/Authentication/AuthenticationResult.cs new file mode 100644 index 0000000000..ebc253172d --- /dev/null +++ b/MediaBrowser.Model/Authentication/AuthenticationResult.cs @@ -0,0 +1,11 @@ +using ProtoBuf;
+
+namespace MediaBrowser.Model.Authentication
+{
+ [ProtoContract]
+ public class AuthenticationResult
+ {
+ [ProtoMember(1)]
+ public bool Success { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs new file mode 100644 index 0000000000..41eb1da2c8 --- /dev/null +++ b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs @@ -0,0 +1,24 @@ +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;
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs new file mode 100644 index 0000000000..5bcd09ef00 --- /dev/null +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -0,0 +1,30 @@ +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;
+ }
+ }
+}
diff --git a/MediaBrowser.Model/DTO/AudioInfo.cs b/MediaBrowser.Model/DTO/AudioInfo.cs new file mode 100644 index 0000000000..9f7675e17a --- /dev/null +++ b/MediaBrowser.Model/DTO/AudioInfo.cs @@ -0,0 +1,23 @@ +using ProtoBuf;
+
+namespace MediaBrowser.Model.DTO
+{
+ [ProtoContract]
+ public class AudioInfo
+ {
+ [ProtoMember(1)]
+ public int BitRate { get; set; }
+
+ [ProtoMember(2)]
+ public int Channels { get; set; }
+
+ [ProtoMember(3)]
+ public string Artist { get; set; }
+
+ [ProtoMember(4)]
+ public string Album { get; set; }
+
+ [ProtoMember(5)]
+ public string AlbumArtist { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/DTO/AudioOutputFormats.cs b/MediaBrowser.Model/DTO/AudioOutputFormats.cs new file mode 100644 index 0000000000..1ae044473a --- /dev/null +++ b/MediaBrowser.Model/DTO/AudioOutputFormats.cs @@ -0,0 +1,15 @@ +
+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
+ }
+}
diff --git a/MediaBrowser.Model/DTO/DTOBaseItem.cs b/MediaBrowser.Model/DTO/DTOBaseItem.cs new file mode 100644 index 0000000000..61607ab02c --- /dev/null +++ b/MediaBrowser.Model/DTO/DTOBaseItem.cs @@ -0,0 +1,178 @@ +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);
+ }
+ }
+}
diff --git a/MediaBrowser.Model/DTO/DTOUser.cs b/MediaBrowser.Model/DTO/DTOUser.cs new file mode 100644 index 0000000000..766cd741ee --- /dev/null +++ b/MediaBrowser.Model/DTO/DTOUser.cs @@ -0,0 +1,27 @@ +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; }
+ }
+}
diff --git a/MediaBrowser.Model/DTO/DTOUserItemData.cs b/MediaBrowser.Model/DTO/DTOUserItemData.cs new file mode 100644 index 0000000000..ce258f16f6 --- /dev/null +++ b/MediaBrowser.Model/DTO/DTOUserItemData.cs @@ -0,0 +1,23 @@ +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; }
+ }
+}
diff --git a/MediaBrowser.Model/DTO/IBNItem.cs b/MediaBrowser.Model/DTO/IBNItem.cs new file mode 100644 index 0000000000..507a37272b --- /dev/null +++ b/MediaBrowser.Model/DTO/IBNItem.cs @@ -0,0 +1,65 @@ +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; }
+ }
+}
diff --git a/MediaBrowser.Model/DTO/MovieInfo.cs b/MediaBrowser.Model/DTO/MovieInfo.cs new file mode 100644 index 0000000000..192c805658 --- /dev/null +++ b/MediaBrowser.Model/DTO/MovieInfo.cs @@ -0,0 +1,11 @@ +using ProtoBuf;
+
+namespace MediaBrowser.Model.DTO
+{
+ [ProtoContract]
+ public class MovieInfo
+ {
+ [ProtoMember(1)]
+ public int SpecialFeatureCount { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/DTO/PluginInfo.cs b/MediaBrowser.Model/DTO/PluginInfo.cs new file mode 100644 index 0000000000..12a22b98fb --- /dev/null +++ b/MediaBrowser.Model/DTO/PluginInfo.cs @@ -0,0 +1,33 @@ +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; }
+ }
+}
diff --git a/MediaBrowser.Model/DTO/SeriesInfo.cs b/MediaBrowser.Model/DTO/SeriesInfo.cs new file mode 100644 index 0000000000..ebb39c8c44 --- /dev/null +++ b/MediaBrowser.Model/DTO/SeriesInfo.cs @@ -0,0 +1,18 @@ +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; }
+ }
+}
diff --git a/MediaBrowser.Model/DTO/VideoInfo.cs b/MediaBrowser.Model/DTO/VideoInfo.cs new file mode 100644 index 0000000000..8e0d6f38f1 --- /dev/null +++ b/MediaBrowser.Model/DTO/VideoInfo.cs @@ -0,0 +1,30 @@ +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; }
+ }
+}
diff --git a/MediaBrowser.Model/DTO/VideoOutputFormats.cs b/MediaBrowser.Model/DTO/VideoOutputFormats.cs new file mode 100644 index 0000000000..c3840bff63 --- /dev/null +++ b/MediaBrowser.Model/DTO/VideoOutputFormats.cs @@ -0,0 +1,22 @@ +
+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
+ }
+}
diff --git a/MediaBrowser.Model/Entities/AudioStream.cs b/MediaBrowser.Model/Entities/AudioStream.cs new file mode 100644 index 0000000000..8a4cea4eed --- /dev/null +++ b/MediaBrowser.Model/Entities/AudioStream.cs @@ -0,0 +1,26 @@ +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; }
+ }
+}
diff --git a/MediaBrowser.Model/Entities/IHasProviderIds.cs b/MediaBrowser.Model/Entities/IHasProviderIds.cs new file mode 100644 index 0000000000..96eb78f243 --- /dev/null +++ b/MediaBrowser.Model/Entities/IHasProviderIds.cs @@ -0,0 +1,57 @@ +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);
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Entities/ImageType.cs b/MediaBrowser.Model/Entities/ImageType.cs new file mode 100644 index 0000000000..d9bb06cbca --- /dev/null +++ b/MediaBrowser.Model/Entities/ImageType.cs @@ -0,0 +1,13 @@ +
+namespace MediaBrowser.Model.Entities
+{
+ public enum ImageType
+ {
+ Primary,
+ Art,
+ Backdrop,
+ Banner,
+ Logo,
+ Thumbnail
+ }
+}
diff --git a/MediaBrowser.Model/Entities/ItemSpecialCounts.cs b/MediaBrowser.Model/Entities/ItemSpecialCounts.cs new file mode 100644 index 0000000000..b57be6ca8b --- /dev/null +++ b/MediaBrowser.Model/Entities/ItemSpecialCounts.cs @@ -0,0 +1,23 @@ +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; }
+ }
+}
diff --git a/MediaBrowser.Model/Entities/MetadataProviders.cs b/MediaBrowser.Model/Entities/MetadataProviders.cs new file mode 100644 index 0000000000..b32ec20394 --- /dev/null +++ b/MediaBrowser.Model/Entities/MetadataProviders.cs @@ -0,0 +1,11 @@ +
+namespace MediaBrowser.Model.Entities
+{
+ public enum MetadataProviders
+ {
+ Imdb,
+ Tmdb,
+ Tvdb,
+ Tvcom
+ }
+}
diff --git a/MediaBrowser.Model/Entities/SubtitleStream.cs b/MediaBrowser.Model/Entities/SubtitleStream.cs new file mode 100644 index 0000000000..7a59d93024 --- /dev/null +++ b/MediaBrowser.Model/Entities/SubtitleStream.cs @@ -0,0 +1,17 @@ +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; }
+ }
+}
diff --git a/MediaBrowser.Model/Entities/VideoType.cs b/MediaBrowser.Model/Entities/VideoType.cs new file mode 100644 index 0000000000..0d46ff7700 --- /dev/null +++ b/MediaBrowser.Model/Entities/VideoType.cs @@ -0,0 +1,12 @@ +
+namespace MediaBrowser.Model.Entities
+{
+ public enum VideoType
+ {
+ VideoFile,
+ Iso,
+ Dvd,
+ BluRay,
+ HdDvd
+ }
+}
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj new file mode 100644 index 0000000000..f7bd3a3ba7 --- /dev/null +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -0,0 +1,80 @@ +<?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>
+ -->
+</Project>
\ No newline at end of file diff --git a/MediaBrowser.Model/Plugins/BasePluginConfiguration.cs b/MediaBrowser.Model/Plugins/BasePluginConfiguration.cs new file mode 100644 index 0000000000..e33ebcce78 --- /dev/null +++ b/MediaBrowser.Model/Plugins/BasePluginConfiguration.cs @@ -0,0 +1,13 @@ +
+namespace MediaBrowser.Model.Plugins
+{
+ public class BasePluginConfiguration
+ {
+ public bool Enabled { get; set; }
+
+ public BasePluginConfiguration()
+ {
+ Enabled = true;
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Progress/TaskProgress.cs b/MediaBrowser.Model/Progress/TaskProgress.cs new file mode 100644 index 0000000000..211875fff0 --- /dev/null +++ b/MediaBrowser.Model/Progress/TaskProgress.cs @@ -0,0 +1,19 @@ +
+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; }
+ }
+}
diff --git a/MediaBrowser.Model/Properties/AssemblyInfo.cs b/MediaBrowser.Model/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..a67dc993f2 --- /dev/null +++ b/MediaBrowser.Model/Properties/AssemblyInfo.cs @@ -0,0 +1,28 @@ +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")]
diff --git a/MediaBrowser.Model/Weather/WeatherForecast.cs b/MediaBrowser.Model/Weather/WeatherForecast.cs new file mode 100644 index 0000000000..f77d92366a --- /dev/null +++ b/MediaBrowser.Model/Weather/WeatherForecast.cs @@ -0,0 +1,30 @@ +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; }
+ }
+}
diff --git a/MediaBrowser.Model/Weather/WeatherInfo.cs b/MediaBrowser.Model/Weather/WeatherInfo.cs new file mode 100644 index 0000000000..7cad4d2484 --- /dev/null +++ b/MediaBrowser.Model/Weather/WeatherInfo.cs @@ -0,0 +1,14 @@ +using ProtoBuf;
+
+namespace MediaBrowser.Model.Weather
+{
+ [ProtoContract]
+ public class WeatherInfo
+ {
+ [ProtoMember(1)]
+ public WeatherStatus CurrentWeather { get; set; }
+
+ [ProtoMember(2)]
+ public WeatherForecast[] Forecasts { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/Weather/WeatherStatus.cs b/MediaBrowser.Model/Weather/WeatherStatus.cs new file mode 100644 index 0000000000..7019d319b7 --- /dev/null +++ b/MediaBrowser.Model/Weather/WeatherStatus.cs @@ -0,0 +1,38 @@ +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
+ }
+}
diff --git a/MediaBrowser.Model/Weather/WeatherUnits.cs b/MediaBrowser.Model/Weather/WeatherUnits.cs new file mode 100644 index 0000000000..3bea67b9a4 --- /dev/null +++ b/MediaBrowser.Model/Weather/WeatherUnits.cs @@ -0,0 +1,9 @@ +
+namespace MediaBrowser.Model.Weather
+{
+ public enum WeatherUnits
+ {
+ Fahrenheit,
+ Celsius
+ }
+}
|
