aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Entities
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2013-02-20 17:10:49 -0800
committerLuke <luke.pulverenti@gmail.com>2013-02-20 17:10:49 -0800
commit845554722efaed872948a9e0f7202e3ef52f1b6e (patch)
tree534ab2d11fe4824ed303bb01e885b330631b657e /MediaBrowser.Model/Entities
parent2f142263f080f7b012a0ec2095d350ccf75b49b7 (diff)
parent14bbb6804718ef78a8118fe750896ba679e3b6cb (diff)
Merge pull request #1 from MediaBrowser/Repo
Repo
Diffstat (limited to 'MediaBrowser.Model/Entities')
-rw-r--r--MediaBrowser.Model/Entities/AudioStream.cs26
-rw-r--r--MediaBrowser.Model/Entities/IHasProviderIds.cs57
-rw-r--r--MediaBrowser.Model/Entities/ImageType.cs13
-rw-r--r--MediaBrowser.Model/Entities/ItemSpecialCounts.cs23
-rw-r--r--MediaBrowser.Model/Entities/MetadataProviders.cs11
-rw-r--r--MediaBrowser.Model/Entities/SubtitleStream.cs17
-rw-r--r--MediaBrowser.Model/Entities/VideoType.cs12
7 files changed, 159 insertions, 0 deletions
diff --git a/MediaBrowser.Model/Entities/AudioStream.cs b/MediaBrowser.Model/Entities/AudioStream.cs
new file mode 100644
index 0000000000..8a4cea4eed
--- /dev/null
+++ b/MediaBrowser.Model/Entities/AudioStream.cs
@@ -0,0 +1,26 @@
+using ProtoBuf;
+
+namespace MediaBrowser.Model.Entities
+{
+ [ProtoContract]
+ public class AudioStream
+ {
+ [ProtoMember(1)]
+ public string Codec { get; set; }
+
+ [ProtoMember(2)]
+ public string Language { get; set; }
+
+ [ProtoMember(3)]
+ public int BitRate { get; set; }
+
+ [ProtoMember(4)]
+ public int Channels { get; set; }
+
+ [ProtoMember(5)]
+ public int SampleRate { get; set; }
+
+ [ProtoMember(6)]
+ public bool IsDefault { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/Entities/IHasProviderIds.cs b/MediaBrowser.Model/Entities/IHasProviderIds.cs
new file mode 100644
index 0000000000..96eb78f243
--- /dev/null
+++ b/MediaBrowser.Model/Entities/IHasProviderIds.cs
@@ -0,0 +1,57 @@
+using System.Collections.Generic;
+
+namespace MediaBrowser.Model.Entities
+{
+ /// <summary>
+ /// Since BaseItem and DTOBaseItem both have ProviderIds, this interface helps avoid code repition by using extension methods
+ /// </summary>
+ public interface IHasProviderIds
+ {
+ Dictionary<string, string> ProviderIds { get; set; }
+ }
+
+ public static class ProviderIdsExtensions
+ {
+ /// <summary>
+ /// Gets a provider id
+ /// </summary>
+ public static string GetProviderId(this IHasProviderIds instance, MetadataProviders provider)
+ {
+ return instance.GetProviderId(provider.ToString());
+ }
+
+ /// <summary>
+ /// Gets a provider id
+ /// </summary>
+ public static string GetProviderId(this IHasProviderIds instance, string name)
+ {
+ if (instance.ProviderIds == null)
+ {
+ return null;
+ }
+
+ return instance.ProviderIds[name];
+ }
+
+ /// <summary>
+ /// Sets a provider id
+ /// </summary>
+ public static void SetProviderId(this IHasProviderIds instance, string name, string value)
+ {
+ if (instance.ProviderIds == null)
+ {
+ instance.ProviderIds = new Dictionary<string, string>();
+ }
+
+ instance.ProviderIds[name] = value;
+ }
+
+ /// <summary>
+ /// Sets a provider id
+ /// </summary>
+ public static void SetProviderId(this IHasProviderIds instance, MetadataProviders provider, string value)
+ {
+ instance.SetProviderId(provider.ToString(), value);
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Entities/ImageType.cs b/MediaBrowser.Model/Entities/ImageType.cs
new file mode 100644
index 0000000000..d9bb06cbca
--- /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/Entities/ItemSpecialCounts.cs b/MediaBrowser.Model/Entities/ItemSpecialCounts.cs
new file mode 100644
index 0000000000..b57be6ca8b
--- /dev/null
+++ b/MediaBrowser.Model/Entities/ItemSpecialCounts.cs
@@ -0,0 +1,23 @@
+using ProtoBuf;
+
+namespace MediaBrowser.Model.Entities
+{
+ /// <summary>
+ /// Since it can be slow to collect this data, this class helps provide a way to calculate them all at once.
+ /// </summary>
+ [ProtoContract]
+ public class ItemSpecialCounts
+ {
+ [ProtoMember(1)]
+ public int RecentlyAddedItemCount { get; set; }
+
+ [ProtoMember(2)]
+ public int RecentlyAddedUnPlayedItemCount { get; set; }
+
+ [ProtoMember(3)]
+ public int InProgressItemCount { get; set; }
+
+ [ProtoMember(4)]
+ public decimal PlayedPercentage { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/Entities/MetadataProviders.cs b/MediaBrowser.Model/Entities/MetadataProviders.cs
new file mode 100644
index 0000000000..b32ec20394
--- /dev/null
+++ b/MediaBrowser.Model/Entities/MetadataProviders.cs
@@ -0,0 +1,11 @@
+
+namespace MediaBrowser.Model.Entities
+{
+ public enum MetadataProviders
+ {
+ Imdb,
+ Tmdb,
+ Tvdb,
+ Tvcom
+ }
+}
diff --git a/MediaBrowser.Model/Entities/SubtitleStream.cs b/MediaBrowser.Model/Entities/SubtitleStream.cs
new file mode 100644
index 0000000000..7a59d93024
--- /dev/null
+++ b/MediaBrowser.Model/Entities/SubtitleStream.cs
@@ -0,0 +1,17 @@
+using ProtoBuf;
+
+namespace MediaBrowser.Model.Entities
+{
+ [ProtoContract]
+ public class SubtitleStream
+ {
+ [ProtoMember(1)]
+ public string Language { get; set; }
+
+ [ProtoMember(2)]
+ public bool IsDefault { get; set; }
+
+ [ProtoMember(3)]
+ public bool IsForced { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/Entities/VideoType.cs b/MediaBrowser.Model/Entities/VideoType.cs
new file mode 100644
index 0000000000..0d46ff7700
--- /dev/null
+++ b/MediaBrowser.Model/Entities/VideoType.cs
@@ -0,0 +1,12 @@
+
+namespace MediaBrowser.Model.Entities
+{
+ public enum VideoType
+ {
+ VideoFile,
+ Iso,
+ Dvd,
+ BluRay,
+ HdDvd
+ }
+}