diff options
| author | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-07-12 02:55:27 -0400 |
|---|---|---|
| committer | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-07-12 02:55:27 -0400 |
| commit | b50f78e5da6f3fdfc59e577ca61b88771da7d211 (patch) | |
| tree | 644ba93dc04bb8837a19a9cd5c3dfa8c6d62a91d /MediaBrowser.Model | |
Initial check-in
Diffstat (limited to 'MediaBrowser.Model')
| -rw-r--r-- | MediaBrowser.Model/Configuration/Configuration.cs | 17 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/Audio.cs | 12 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/BaseItem.cs | 64 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/Folder.cs | 96 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/Person.cs | 22 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/PlaybackStatus.cs | 12 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/Video.cs | 42 | ||||
| -rw-r--r-- | MediaBrowser.Model/MediaBrowser.Model.csproj | 73 | ||||
| -rw-r--r-- | MediaBrowser.Model/Properties/AssemblyInfo.cs | 36 | ||||
| -rw-r--r-- | MediaBrowser.Model/Users/User.cs | 19 | ||||
| -rw-r--r-- | MediaBrowser.Model/Users/UserItemData.cs | 23 | ||||
| -rw-r--r-- | MediaBrowser.Model/packages.config | 4 |
12 files changed, 420 insertions, 0 deletions
diff --git a/MediaBrowser.Model/Configuration/Configuration.cs b/MediaBrowser.Model/Configuration/Configuration.cs new file mode 100644 index 000000000..c2aa73728 --- /dev/null +++ b/MediaBrowser.Model/Configuration/Configuration.cs @@ -0,0 +1,17 @@ +using MediaBrowser.Common.Logging;
+
+namespace MediaBrowser.Model.Configuration
+{
+ public class Configuration
+ {
+ public string ImagesByNamePath { get; set; }
+ public int HttpServerPortNumber { get; set; }
+ public LogSeverity LogSeverity { get; set; }
+
+ public Configuration()
+ {
+ HttpServerPortNumber = 8096;
+ LogSeverity = Common.Logging.LogSeverity.Info;
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Entities/Audio.cs b/MediaBrowser.Model/Entities/Audio.cs new file mode 100644 index 000000000..b243411ad --- /dev/null +++ b/MediaBrowser.Model/Entities/Audio.cs @@ -0,0 +1,12 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MediaBrowser.Model.Entities
+{
+ public class Audio : BaseItem
+ {
+ }
+}
diff --git a/MediaBrowser.Model/Entities/BaseItem.cs b/MediaBrowser.Model/Entities/BaseItem.cs new file mode 100644 index 000000000..2eaf375d9 --- /dev/null +++ b/MediaBrowser.Model/Entities/BaseItem.cs @@ -0,0 +1,64 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+
+namespace MediaBrowser.Model.Entities
+{
+ public abstract class BaseItem
+ {
+ public string Name { get; set; }
+ public string SortName { get; set; }
+
+ public Guid Id { get; set; }
+
+ public DateTime DateCreated { get; set; }
+ public DateTime DateModified { get; set; }
+
+ public string Path { get; set; }
+
+ [JsonIgnore]
+ public Folder Parent { get; set; }
+
+ public string PrimaryImagePath { get; set; }
+ public string LogoImagePath { get; set; }
+ public string ArtImagePath { get; set; }
+ public string ThumbnailImagePath { get; set; }
+ public string BannerImagePath { get; set; }
+
+ public IEnumerable<string> BackdropImagePaths { get; set; }
+
+ public string OfficialRating { get; set; }
+
+ public string CustomRating { get; set; }
+ public string CustomPin { get; set; }
+
+ public string Overview { get; set; }
+ public string Tagline { get; set; }
+
+ public IEnumerable<Person> People { get; set; }
+
+ public IEnumerable<string> Studios { get; set; }
+
+ public IEnumerable<string> Genres { get; set; }
+
+ public string DisplayMediaType { get; set; }
+
+ public float? UserRating { get; set; }
+ public TimeSpan? RunTime { get; set; }
+
+ public string AspectRatio { get; set; }
+ public int? ProductionYear { get; set; }
+
+ public IEnumerable<Video> LocalTrailers { get; set; }
+
+ public string TrailerUrl { get; set; }
+
+ public override string ToString()
+ {
+ return Name;
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Entities/Folder.cs b/MediaBrowser.Model/Entities/Folder.cs new file mode 100644 index 000000000..6af9bf259 --- /dev/null +++ b/MediaBrowser.Model/Entities/Folder.cs @@ -0,0 +1,96 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.IO;
+using Newtonsoft.Json;
+
+namespace MediaBrowser.Model.Entities
+{
+ public class Folder : BaseItem
+ {
+ public bool IsRoot { get; set; }
+
+ public bool IsVirtualFolder
+ {
+ get
+ {
+ return Parent != null && Parent.IsRoot;
+ }
+ }
+
+ [JsonIgnore]
+ public BaseItem[] Children { get; set; }
+
+ [JsonIgnore]
+ public IEnumerable<Folder> FolderChildren { get { return Children.OfType<Folder>(); } }
+
+ public Folder GetFolderByName(string name)
+ {
+ return FolderChildren.FirstOrDefault(f => System.IO.Path.GetFileName(f.Path).Equals(name, StringComparison.OrdinalIgnoreCase));
+ }
+
+ /// <summary>
+ /// Finds an item by ID, recursively
+ /// </summary>
+ public BaseItem FindById(Guid id)
+ {
+ if (Id == id)
+ {
+ return this;
+ }
+
+ foreach (BaseItem item in Children)
+ {
+ if (item.Id == id)
+ {
+ return item;
+ }
+ }
+
+ foreach (Folder folder in FolderChildren)
+ {
+ BaseItem item = folder.FindById(id);
+
+ if (item != null)
+ {
+ return item;
+ }
+ }
+
+ return null;
+ }
+
+ /// <summary>
+ /// Finds an item by path, recursively
+ /// </summary>
+ public BaseItem FindByPath(string path)
+ {
+ if (Path.Equals(path, StringComparison.OrdinalIgnoreCase))
+ {
+ return this;
+ }
+
+ foreach (BaseItem item in Children)
+ {
+ if (item.Path.Equals(path, StringComparison.OrdinalIgnoreCase))
+ {
+ return item;
+ }
+ }
+
+ foreach (Folder folder in FolderChildren)
+ {
+ BaseItem item = folder.FindByPath(path);
+
+ if (item != null)
+ {
+ return item;
+ }
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Entities/Person.cs b/MediaBrowser.Model/Entities/Person.cs new file mode 100644 index 000000000..320491d02 --- /dev/null +++ b/MediaBrowser.Model/Entities/Person.cs @@ -0,0 +1,22 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MediaBrowser.Model.Entities
+{
+ public class Person
+ {
+ public string Name { get; set; }
+ public string Description { get; set; }
+ public PersonType PersonType { get; set; }
+ }
+
+ public enum PersonType
+ {
+ Actor = 1,
+ Director = 2,
+ Writer = 3
+ }
+}
diff --git a/MediaBrowser.Model/Entities/PlaybackStatus.cs b/MediaBrowser.Model/Entities/PlaybackStatus.cs new file mode 100644 index 000000000..042cfe098 --- /dev/null +++ b/MediaBrowser.Model/Entities/PlaybackStatus.cs @@ -0,0 +1,12 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MediaBrowser.Model.Entities
+{
+ public class PlaybackStatus
+ {
+ }
+}
diff --git a/MediaBrowser.Model/Entities/Video.cs b/MediaBrowser.Model/Entities/Video.cs new file mode 100644 index 000000000..8b27f47c8 --- /dev/null +++ b/MediaBrowser.Model/Entities/Video.cs @@ -0,0 +1,42 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MediaBrowser.Model.Entities
+{
+ public class Video : BaseItem
+ {
+ public VideoType VideoType { get; set; }
+
+ private IEnumerable<string> _Subtitles = new string[] { };
+ public IEnumerable<string> Subtitles { get { return _Subtitles; } set { _Subtitles = value; } }
+
+ private IEnumerable<AudioStream> _AudioStreams = new AudioStream[] { };
+ public IEnumerable<AudioStream> AudioStreams { get { return _AudioStreams; } set { _AudioStreams = value; } }
+
+ public int Height { get; set; }
+ public int Width { get; set; }
+ public string ScanType { get; set; }
+ public string FrameRate { get; set; }
+ public int VideoBitRate { get; set; }
+ public string VideoCodec { get; set; }
+ }
+
+ public class AudioStream
+ {
+ public string AudioFormat { get; set; }
+ public string AudioProfile { get; set; }
+ public string Language { get; set; }
+ public int BitRate { get; set; }
+ public int Channels { get; set; }
+ }
+
+ public enum VideoType
+ {
+ VideoFile = 1,
+ DVD = 2,
+ BluRay = 3
+ }
+}
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj new file mode 100644 index 000000000..2f3548661 --- /dev/null +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -0,0 +1,73 @@ +<?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>{9B1DDD79-5134-4DF3-ACE3-D1957A7350D8}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>MediaBrowser.Model</RootNamespace>
+ <AssemblyName>MediaBrowser.Model</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </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>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.4.5.7\lib\net40\Newtonsoft.Json.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Configuration\Configuration.cs" />
+ <Compile Include="Entities\Person.cs" />
+ <Compile Include="Entities\Audio.cs" />
+ <Compile Include="Entities\BaseItem.cs" />
+ <Compile Include="Entities\Folder.cs" />
+ <Compile Include="Entities\PlaybackStatus.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Users\User.cs" />
+ <Compile Include="Users\UserItemData.cs" />
+ <Compile Include="Entities\Video.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj">
+ <Project>{9142eefa-7570-41e1-bfcc-468bb571af2f}</Project>
+ <Name>MediaBrowser.Common</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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>
+ -->
+</Project>
\ No newline at end of file diff --git a/MediaBrowser.Model/Properties/AssemblyInfo.cs b/MediaBrowser.Model/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..c5af59e20 --- /dev/null +++ b/MediaBrowser.Model/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 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("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("4478b410-9582-4c22-b890-2a309708b9f1")]
+
+// 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/Users/User.cs b/MediaBrowser.Model/Users/User.cs new file mode 100644 index 000000000..19b65fce4 --- /dev/null +++ b/MediaBrowser.Model/Users/User.cs @@ -0,0 +1,19 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MediaBrowser.Model.Entities;
+
+namespace MediaBrowser.Model.Users
+{
+ public class User : BaseItem
+ {
+ public string Password { get; set; }
+ public string MaxParentalRating { get; set; }
+ public bool HideBlockedContent { get; set; }
+
+ private Dictionary<Guid, UserItemData> _ItemData = new Dictionary<Guid, UserItemData>();
+ public Dictionary<Guid, UserItemData> ItemData { get { return _ItemData; } set { _ItemData = value; } }
+ }
+}
diff --git a/MediaBrowser.Model/Users/UserItemData.cs b/MediaBrowser.Model/Users/UserItemData.cs new file mode 100644 index 000000000..ddb78555f --- /dev/null +++ b/MediaBrowser.Model/Users/UserItemData.cs @@ -0,0 +1,23 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MediaBrowser.Model.Entities;
+
+namespace MediaBrowser.Model.Users
+{
+ public class UserItemData
+ {
+ public UserItemRating Rating { get; set; }
+
+ public PlaybackStatus PlaybackStatus { get; set; }
+ }
+
+ public enum UserItemRating
+ {
+ Likes,
+ Dislikes,
+ Favorite
+ }
+}
diff --git a/MediaBrowser.Model/packages.config b/MediaBrowser.Model/packages.config new file mode 100644 index 000000000..9bfda3802 --- /dev/null +++ b/MediaBrowser.Model/packages.config @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Newtonsoft.Json" version="4.5.7" targetFramework="net45" />
+</packages>
\ No newline at end of file |
