aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
authorLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-07-16 12:50:44 -0400
committerLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-07-16 12:50:44 -0400
commit6fbd5cf46407a212fadb52eee00c7ac7690430ea (patch)
tree0e21ea9603d6c78801ac01e1e0e412acd2341a45 /MediaBrowser.Model
parentbaedafbeb92db3ddf434f038984970bf0a6ac0c1 (diff)
All calls to get items now require passing in a userId. Made the model project portable. Also filled in more api calls.
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Configuration/Configuration.cs2
-rw-r--r--MediaBrowser.Model/Entities/Audio.cs7
-rw-r--r--MediaBrowser.Model/Entities/BaseItem.cs12
-rw-r--r--MediaBrowser.Model/Entities/CategoryInfo.cs21
-rw-r--r--MediaBrowser.Model/Entities/Folder.cs13
-rw-r--r--MediaBrowser.Model/Entities/Genre.cs7
-rw-r--r--MediaBrowser.Model/Entities/Person.cs14
-rw-r--r--MediaBrowser.Model/Entities/PlaybackStatus.cs12
-rw-r--r--MediaBrowser.Model/Entities/Studio.cs7
-rw-r--r--MediaBrowser.Model/Entities/Video.cs12
-rw-r--r--MediaBrowser.Model/Entities/Year.cs7
-rw-r--r--MediaBrowser.Model/Logging/LogSeverity.cs4
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj26
-rw-r--r--MediaBrowser.Model/Properties/AssemblyInfo.cs12
-rw-r--r--MediaBrowser.Model/Users/User.cs4
-rw-r--r--MediaBrowser.Model/Users/UserItemData.cs12
16 files changed, 75 insertions, 97 deletions
diff --git a/MediaBrowser.Model/Configuration/Configuration.cs b/MediaBrowser.Model/Configuration/Configuration.cs
index 63ed22fc5..e7dc4b843 100644
--- a/MediaBrowser.Model/Configuration/Configuration.cs
+++ b/MediaBrowser.Model/Configuration/Configuration.cs
@@ -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;
}
}
diff --git a/MediaBrowser.Model/Entities/Audio.cs b/MediaBrowser.Model/Entities/Audio.cs
index b243411ad..bfd739b5a 100644
--- a/MediaBrowser.Model/Entities/Audio.cs
+++ b/MediaBrowser.Model/Entities/Audio.cs
@@ -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
diff --git a/MediaBrowser.Model/Entities/BaseItem.cs b/MediaBrowser.Model/Entities/BaseItem.cs
index a9c564a28..165328ac7 100644
--- a/MediaBrowser.Model/Entities/BaseItem.cs
+++ b/MediaBrowser.Model/Entities/BaseItem.cs
@@ -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; }
@@ -63,17 +64,6 @@ namespace MediaBrowser.Model.Entities
/// <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>
public string Type
{
get
diff --git a/MediaBrowser.Model/Entities/CategoryInfo.cs b/MediaBrowser.Model/Entities/CategoryInfo.cs
new file mode 100644
index 000000000..adf8ac7d9
--- /dev/null
+++ b/MediaBrowser.Model/Entities/CategoryInfo.cs
@@ -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; }
+ }
+}
diff --git a/MediaBrowser.Model/Entities/Folder.cs b/MediaBrowser.Model/Entities/Folder.cs
index 5ae47fea3..edcb981de 100644
--- a/MediaBrowser.Model/Entities/Folder.cs
+++ b/MediaBrowser.Model/Entities/Folder.cs
@@ -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>
diff --git a/MediaBrowser.Model/Entities/Genre.cs b/MediaBrowser.Model/Entities/Genre.cs
new file mode 100644
index 000000000..79dea52be
--- /dev/null
+++ b/MediaBrowser.Model/Entities/Genre.cs
@@ -0,0 +1,7 @@
+
+namespace MediaBrowser.Model.Entities
+{
+ public class Genre : BaseItem
+ {
+ }
+}
diff --git a/MediaBrowser.Model/Entities/Person.cs b/MediaBrowser.Model/Entities/Person.cs
index 521adb50c..93f541a18 100644
--- a/MediaBrowser.Model/Entities/Person.cs
+++ b/MediaBrowser.Model/Entities/Person.cs
@@ -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
}
}
diff --git a/MediaBrowser.Model/Entities/PlaybackStatus.cs b/MediaBrowser.Model/Entities/PlaybackStatus.cs
deleted file mode 100644
index 042cfe098..000000000
--- a/MediaBrowser.Model/Entities/PlaybackStatus.cs
+++ /dev/null
@@ -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
- {
- }
-}
diff --git a/MediaBrowser.Model/Entities/Studio.cs b/MediaBrowser.Model/Entities/Studio.cs
new file mode 100644
index 000000000..da9582aed
--- /dev/null
+++ b/MediaBrowser.Model/Entities/Studio.cs
@@ -0,0 +1,7 @@
+
+namespace MediaBrowser.Model.Entities
+{
+ public class Studio : BaseItem
+ {
+ }
+}
diff --git a/MediaBrowser.Model/Entities/Video.cs b/MediaBrowser.Model/Entities/Video.cs
index 8b27f47c8..4d7b473bb 100644
--- a/MediaBrowser.Model/Entities/Video.cs
+++ b/MediaBrowser.Model/Entities/Video.cs
@@ -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
}
}
diff --git a/MediaBrowser.Model/Entities/Year.cs b/MediaBrowser.Model/Entities/Year.cs
new file mode 100644
index 000000000..6c25f2ac5
--- /dev/null
+++ b/MediaBrowser.Model/Entities/Year.cs
@@ -0,0 +1,7 @@
+
+namespace MediaBrowser.Model.Entities
+{
+ public class Year : BaseItem
+ {
+ }
+}
diff --git a/MediaBrowser.Model/Logging/LogSeverity.cs b/MediaBrowser.Model/Logging/LogSeverity.cs
index 54187997f..bac03acdd 100644
--- a/MediaBrowser.Model/Logging/LogSeverity.cs
+++ b/MediaBrowser.Model/Logging/LogSeverity.cs
@@ -1,8 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace MediaBrowser.Model.Logging
{
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index b0030dded..431ec7fde 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -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">
diff --git a/MediaBrowser.Model/Properties/AssemblyInfo.cs b/MediaBrowser.Model/Properties/AssemblyInfo.cs
index c5af59e20..6c64a5de6 100644
--- a/MediaBrowser.Model/Properties/AssemblyInfo.cs
+++ b/MediaBrowser.Model/Properties/AssemblyInfo.cs
@@ -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:
//
diff --git a/MediaBrowser.Model/Users/User.cs b/MediaBrowser.Model/Users/User.cs
index 19b65fce4..316e5b55c 100644
--- a/MediaBrowser.Model/Users/User.cs
+++ b/MediaBrowser.Model/Users/User.cs
@@ -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; } }
diff --git a/MediaBrowser.Model/Users/UserItemData.cs b/MediaBrowser.Model/Users/UserItemData.cs
index ddb78555f..9782711b0 100644
--- a/MediaBrowser.Model/Users/UserItemData.cs
+++ b/MediaBrowser.Model/Users/UserItemData.cs
@@ -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