All calls to get items now require passing in a userId. Made the model project portable. Also filled in more api calls.

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-07-16 12:50:44 -04:00
parent baedafbeb9
commit 6fbd5cf464
46 changed files with 986 additions and 410 deletions

View File

@@ -6,11 +6,13 @@ namespace MediaBrowser.Model.Configuration
{
public string ImagesByNamePath { get; set; }
public int HttpServerPortNumber { get; set; }
public int RecentItemDays { get; set; }
public LogSeverity LogSeverity { get; set; }
public Configuration()
{
HttpServerPortNumber = 8096;
RecentItemDays = 14;
LogSeverity = LogSeverity.Info;
}
}

View File

@@ -1,9 +1,4 @@
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

@@ -51,6 +51,7 @@ namespace MediaBrowser.Model.Entities
public virtual string AspectRatio { get; set; }
public virtual int? ProductionYear { get; set; }
[IgnoreDataMember]
public virtual IEnumerable<Video> LocalTrailers { get; set; }
public virtual string TrailerUrl { get; set; }
@@ -60,17 +61,6 @@ namespace MediaBrowser.Model.Entities
return Name;
}
/// <summary>
/// This is strictly to enhance json output, until I can find a way to customize service stack to add this without having to use a property
/// </summary>
public virtual bool IsFolder
{
get
{
return false;
}
}
/// <summary>
/// This is strictly to enhance json output, until I can find a way to customize service stack to add this without having to use a property
/// </summary>

View File

@@ -0,0 +1,21 @@

namespace MediaBrowser.Model.Entities
{
/// <summary>
/// This is a stub class used by the api to get IBN types in a compact format
/// </summary>
public class CategoryInfo
{
/// <summary>
/// The name of the genre, year, studio, etc
/// </summary>
public string Name { get; set; }
public string PrimaryImagePath { get; set; }
/// <summary>
/// The number of items that have the genre, year, studio, etc
/// </summary>
public int ItemCount { get; set; }
}
}

View File

@@ -18,25 +18,12 @@ namespace MediaBrowser.Model.Entities
}
}
public override bool IsFolder
{
get
{
return true;
}
}
[IgnoreDataMember]
public BaseItem[] Children { get; set; }
[IgnoreDataMember]
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>

View File

@@ -0,0 +1,7 @@

namespace MediaBrowser.Model.Entities
{
public class Genre : BaseItem
{
}
}

View File

@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MediaBrowser.Model.Entities
{
/// <summary>
@@ -26,8 +21,9 @@ namespace MediaBrowser.Model.Entities
public enum PersonType
{
Actor = 1,
Director = 2,
Writer = 3
Actor,
Director,
Writer,
Producer
}
}

View File

@@ -1,12 +0,0 @@
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,7 @@

namespace MediaBrowser.Model.Entities
{
public class Studio : BaseItem
{
}
}

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace MediaBrowser.Model.Entities
{
@@ -35,8 +31,8 @@ namespace MediaBrowser.Model.Entities
public enum VideoType
{
VideoFile = 1,
DVD = 2,
BluRay = 3
VideoFile,
DVD,
BluRay
}
}

View File

@@ -0,0 +1,7 @@

namespace MediaBrowser.Model.Entities
{
public class Year : BaseItem
{
}
}

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MediaBrowser.Model.Logging
{

View File

@@ -4,13 +4,15 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9B1DDD79-5134-4DF3-ACE3-D1957A7350D8}</ProjectGuid>
<ProjectGuid>{7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MediaBrowser.Model</RootNamespace>
<AssemblyName>MediaBrowser.Model</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<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>
@@ -30,29 +32,25 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<!-- A reference to the entire .NET Framework is automatically included -->
</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\CategoryInfo.cs" />
<Compile Include="Entities\Folder.cs" />
<Compile Include="Entities\PlaybackStatus.cs" />
<Compile Include="Entities\Genre.cs" />
<Compile Include="Entities\Person.cs" />
<Compile Include="Entities\Studio.cs" />
<Compile Include="Entities\Video.cs" />
<Compile Include="Entities\Year.cs" />
<Compile Include="Logging\LogSeverity.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Users\User.cs" />
<Compile Include="Users\UserItemData.cs" />
<Compile Include="Entities\Video.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.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">

View File

@@ -1,4 +1,5 @@
using System.Reflection;
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -13,14 +14,7 @@ using System.Runtime.InteropServices;
[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")]
[assembly: NeutralResourcesLanguage("en")]
// Version information for an assembly consists of the following four values:
//

View File

@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.Users
@@ -11,7 +8,6 @@ namespace MediaBrowser.Model.Users
{
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

@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Entities;
using System;
namespace MediaBrowser.Model.Users
{
@@ -11,7 +7,9 @@ namespace MediaBrowser.Model.Users
{
public UserItemRating Rating { get; set; }
public PlaybackStatus PlaybackStatus { get; set; }
public TimeSpan PlaybackPosition { get; set; }
public int PlayCount { get; set; }
}
public enum UserItemRating