Initial check-in

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-07-12 02:55:27 -04:00
commit b50f78e5da
93 changed files with 5325 additions and 0 deletions

View File

@@ -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;
}
}
}

View File

@@ -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
{
}
}

View File

@@ -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;
}
}
}

View File

@@ -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;
}
}
}

View File

@@ -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
}
}

View File

@@ -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
{
}
}

View File

@@ -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
}
}

View File

@@ -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>

View File

@@ -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")]

View File

@@ -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; } }
}
}

View File

@@ -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
}
}

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="4.5.7" targetFramework="net45" />
</packages>