aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
authorLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-07-30 15:03:07 -0400
committerLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-07-30 15:03:07 -0400
commit7d48e20aea2e2a08137ec23d0076b86755f648d3 (patch)
tree1c8caad19a000b4062546e755729ed1c130c5106 /MediaBrowser.Model
parent45cde97a585ca295be8defa11e85376ec1bd0ada (diff)
Reworked CategoryInfo and added ImageType enum
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Entities/ApiBaseItem.cs13
-rw-r--r--MediaBrowser.Model/Entities/CategoryInfo.cs10
-rw-r--r--MediaBrowser.Model/Entities/ImageType.cs13
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj1
4 files changed, 30 insertions, 7 deletions
diff --git a/MediaBrowser.Model/Entities/ApiBaseItem.cs b/MediaBrowser.Model/Entities/ApiBaseItem.cs
index 665a2f6c6..b3fbbbcde 100644
--- a/MediaBrowser.Model/Entities/ApiBaseItem.cs
+++ b/MediaBrowser.Model/Entities/ApiBaseItem.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using MediaBrowser.Model.Users;
namespace MediaBrowser.Model.Entities
@@ -26,5 +27,15 @@ namespace MediaBrowser.Model.Entities
public bool IsFolder { get; set; }
public string Type { 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/Entities/CategoryInfo.cs b/MediaBrowser.Model/Entities/CategoryInfo.cs
index adf8ac7d9..934a0ae1d 100644
--- a/MediaBrowser.Model/Entities/CategoryInfo.cs
+++ b/MediaBrowser.Model/Entities/CategoryInfo.cs
@@ -2,16 +2,14 @@
namespace MediaBrowser.Model.Entities
{
/// <summary>
- /// This is a stub class used by the api to get IBN types in a compact format
+ /// This is a stub class used by the api to get IBN types along with their item counts
/// </summary>
- public class CategoryInfo
+ public class CategoryInfo<T>
{
/// <summary>
- /// The name of the genre, year, studio, etc
+ /// The actual genre, year, studio, etc
/// </summary>
- public string Name { get; set; }
-
- public string PrimaryImagePath { get; set; }
+ public T Item { get; set; }
/// <summary>
/// The number of items that have the genre, year, studio, etc
diff --git a/MediaBrowser.Model/Entities/ImageType.cs b/MediaBrowser.Model/Entities/ImageType.cs
new file mode 100644
index 000000000..d9bb06cbc
--- /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/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index 9338b3884..0157fcbf8 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -47,6 +47,7 @@
<Compile Include="Entities\CategoryInfo.cs" />
<Compile Include="Entities\Folder.cs" />
<Compile Include="Entities\Genre.cs" />
+ <Compile Include="Entities\ImageType.cs" />
<Compile Include="Entities\Person.cs" />
<Compile Include="Entities\Studio.cs" />
<Compile Include="Entities\Video.cs" />