diff options
Diffstat (limited to 'MediaBrowser.Model/Entities')
| -rw-r--r-- | MediaBrowser.Model/Entities/AudioStream.cs | 26 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/IHasProviderIds.cs | 57 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/ImageType.cs | 13 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/ItemSpecialCounts.cs | 23 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/MetadataProviders.cs | 11 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/SubtitleStream.cs | 17 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/VideoType.cs | 12 |
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 000000000..8a4cea4ee --- /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 000000000..96eb78f24 --- /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 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/Entities/ItemSpecialCounts.cs b/MediaBrowser.Model/Entities/ItemSpecialCounts.cs new file mode 100644 index 000000000..b57be6ca8 --- /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 000000000..b32ec2039 --- /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 000000000..7a59d9302 --- /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 000000000..0d46ff770 --- /dev/null +++ b/MediaBrowser.Model/Entities/VideoType.cs @@ -0,0 +1,12 @@ +
+namespace MediaBrowser.Model.Entities
+{
+ public enum VideoType
+ {
+ VideoFile,
+ Iso,
+ Dvd,
+ BluRay,
+ HdDvd
+ }
+}
|
