From bb031f553b940d21fa89f319d294745484c2234e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 8 May 2014 16:26:20 -0400 Subject: fix portable and 3.5 project references --- MediaBrowser.Model/Entities/DisplayPreferences.cs | 30 ------ MediaBrowser.Model/Entities/EmptyRequestResult.cs | 7 ++ MediaBrowser.Model/Entities/IHasProviderIds.cs | 101 +------------------- MediaBrowser.Model/Entities/IsoType.cs | 17 ++++ MediaBrowser.Model/Entities/MediaInfo.cs | 26 ++++++ MediaBrowser.Model/Entities/MediaStream.cs | 48 +--------- MediaBrowser.Model/Entities/MediaStreamType.cs | 25 +++++ MediaBrowser.Model/Entities/MediaUrl.cs | 6 -- MediaBrowser.Model/Entities/PackageReviewInfo.cs | 4 - .../Entities/ProviderIdsExtensions.cs | 103 +++++++++++++++++++++ MediaBrowser.Model/Entities/RequestResult.cs | 7 -- MediaBrowser.Model/Entities/ScrollDirection.cs | 17 ++++ MediaBrowser.Model/Entities/SortOrder.cs | 17 ++++ MediaBrowser.Model/Entities/VideoSize.cs | 8 ++ MediaBrowser.Model/Entities/VideoType.cs | 15 --- 15 files changed, 222 insertions(+), 209 deletions(-) create mode 100644 MediaBrowser.Model/Entities/EmptyRequestResult.cs create mode 100644 MediaBrowser.Model/Entities/IsoType.cs create mode 100644 MediaBrowser.Model/Entities/MediaInfo.cs create mode 100644 MediaBrowser.Model/Entities/MediaStreamType.cs create mode 100644 MediaBrowser.Model/Entities/ProviderIdsExtensions.cs delete mode 100644 MediaBrowser.Model/Entities/RequestResult.cs create mode 100644 MediaBrowser.Model/Entities/ScrollDirection.cs create mode 100644 MediaBrowser.Model/Entities/SortOrder.cs create mode 100644 MediaBrowser.Model/Entities/VideoSize.cs (limited to 'MediaBrowser.Model/Entities') diff --git a/MediaBrowser.Model/Entities/DisplayPreferences.cs b/MediaBrowser.Model/Entities/DisplayPreferences.cs index 62233ac275..2fdab9799e 100644 --- a/MediaBrowser.Model/Entities/DisplayPreferences.cs +++ b/MediaBrowser.Model/Entities/DisplayPreferences.cs @@ -122,34 +122,4 @@ namespace MediaBrowser.Model.Entities PrimaryImageHeight = Convert.ToInt32(size.Height); } } - - /// - /// Enum ScrollDirection - /// - public enum ScrollDirection - { - /// - /// The horizontal - /// - Horizontal, - /// - /// The vertical - /// - Vertical - } - - /// - /// Enum SortOrder - /// - public enum SortOrder - { - /// - /// The ascending - /// - Ascending, - /// - /// The descending - /// - Descending - } } diff --git a/MediaBrowser.Model/Entities/EmptyRequestResult.cs b/MediaBrowser.Model/Entities/EmptyRequestResult.cs new file mode 100644 index 0000000000..5c9a725fd9 --- /dev/null +++ b/MediaBrowser.Model/Entities/EmptyRequestResult.cs @@ -0,0 +1,7 @@ + +namespace MediaBrowser.Model.Entities +{ + public class EmptyRequestResult + { + } +} diff --git a/MediaBrowser.Model/Entities/IHasProviderIds.cs b/MediaBrowser.Model/Entities/IHasProviderIds.cs index efb75412f5..796850dbd4 100644 --- a/MediaBrowser.Model/Entities/IHasProviderIds.cs +++ b/MediaBrowser.Model/Entities/IHasProviderIds.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; namespace MediaBrowser.Model.Entities { @@ -14,102 +13,4 @@ namespace MediaBrowser.Model.Entities /// The provider ids. Dictionary ProviderIds { get; set; } } - - /// - /// Class ProviderIdsExtensions - /// - public static class ProviderIdsExtensions - { - /// - /// Determines whether [has provider identifier] [the specified instance]. - /// - /// The instance. - /// The provider. - /// true if [has provider identifier] [the specified instance]; otherwise, false. - public static bool HasProviderId(this IHasProviderIds instance, MetadataProviders provider) - { - return !string.IsNullOrEmpty(instance.GetProviderId(provider.ToString())); - } - - /// - /// Gets a provider id - /// - /// The instance. - /// The provider. - /// System.String. - public static string GetProviderId(this IHasProviderIds instance, MetadataProviders provider) - { - return instance.GetProviderId(provider.ToString()); - } - - /// - /// Gets a provider id - /// - /// The instance. - /// The name. - /// System.String. - public static string GetProviderId(this IHasProviderIds instance, string name) - { - if (instance == null) - { - throw new ArgumentNullException("instance"); - } - - if (instance.ProviderIds == null) - { - return null; - } - - string id; - instance.ProviderIds.TryGetValue(name, out id); - return id; - } - - /// - /// Sets a provider id - /// - /// The instance. - /// The name. - /// The value. - public static void SetProviderId(this IHasProviderIds instance, string name, string value) - { - if (instance == null) - { - throw new ArgumentNullException("instance"); - } - - // If it's null remove the key from the dictionary - if (string.IsNullOrEmpty(value)) - { - if (instance.ProviderIds != null) - { - if (instance.ProviderIds.ContainsKey(name)) - { - instance.ProviderIds.Remove(name); - } - } - } - else - { - // Ensure it exists - if (instance.ProviderIds == null) - { - instance.ProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase); - } - - instance.ProviderIds[name] = value; - } - } - - /// - /// Sets a provider id - /// - /// The instance. - /// The provider. - /// The value. - public static void SetProviderId(this IHasProviderIds instance, MetadataProviders provider, string value) - { - instance.SetProviderId(provider.ToString(), value); - } - } } diff --git a/MediaBrowser.Model/Entities/IsoType.cs b/MediaBrowser.Model/Entities/IsoType.cs new file mode 100644 index 0000000000..567b98ab9a --- /dev/null +++ b/MediaBrowser.Model/Entities/IsoType.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Model.Entities +{ + /// + /// Enum IsoType + /// + public enum IsoType + { + /// + /// The DVD + /// + Dvd, + /// + /// The blu ray + /// + BluRay + } +} \ No newline at end of file diff --git a/MediaBrowser.Model/Entities/MediaInfo.cs b/MediaBrowser.Model/Entities/MediaInfo.cs new file mode 100644 index 0000000000..ef26cfa148 --- /dev/null +++ b/MediaBrowser.Model/Entities/MediaInfo.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; + +namespace MediaBrowser.Model.Entities +{ + public class MediaInfo + { + /// + /// Gets or sets the media streams. + /// + /// The media streams. + public List MediaStreams { get; set; } + + /// + /// Gets or sets the format. + /// + /// The format. + public string Format { get; set; } + + public int? TotalBitrate { get; set; } + + public MediaInfo() + { + MediaStreams = new List(); + } + } +} \ No newline at end of file diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs index d54e3c0ef9..66163c1ef7 100644 --- a/MediaBrowser.Model/Entities/MediaStream.cs +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.Diagnostics; +using System.Diagnostics; namespace MediaBrowser.Model.Entities { @@ -147,49 +146,4 @@ namespace MediaBrowser.Model.Entities /// The level. public double? Level { get; set; } } - - /// - /// Enum MediaStreamType - /// - public enum MediaStreamType - { - /// - /// The audio - /// - Audio, - /// - /// The video - /// - Video, - /// - /// The subtitle - /// - Subtitle, - /// - /// The embedded image - /// - EmbeddedImage - } - - public class MediaInfo - { - /// - /// Gets or sets the media streams. - /// - /// The media streams. - public List MediaStreams { get; set; } - - /// - /// Gets or sets the format. - /// - /// The format. - public string Format { get; set; } - - public int? TotalBitrate { get; set; } - - public MediaInfo() - { - MediaStreams = new List(); - } - } } diff --git a/MediaBrowser.Model/Entities/MediaStreamType.cs b/MediaBrowser.Model/Entities/MediaStreamType.cs new file mode 100644 index 0000000000..084a411f9c --- /dev/null +++ b/MediaBrowser.Model/Entities/MediaStreamType.cs @@ -0,0 +1,25 @@ +namespace MediaBrowser.Model.Entities +{ + /// + /// Enum MediaStreamType + /// + public enum MediaStreamType + { + /// + /// The audio + /// + Audio, + /// + /// The video + /// + Video, + /// + /// The subtitle + /// + Subtitle, + /// + /// The embedded image + /// + EmbeddedImage + } +} \ No newline at end of file diff --git a/MediaBrowser.Model/Entities/MediaUrl.cs b/MediaBrowser.Model/Entities/MediaUrl.cs index 857e91fec5..9aa7207ed1 100644 --- a/MediaBrowser.Model/Entities/MediaUrl.cs +++ b/MediaBrowser.Model/Entities/MediaUrl.cs @@ -8,10 +8,4 @@ namespace MediaBrowser.Model.Entities public VideoSize? VideoSize { get; set; } public bool IsDirectLink { get; set; } } - - public enum VideoSize - { - StandardDefinition, - HighDefinition - } } diff --git a/MediaBrowser.Model/Entities/PackageReviewInfo.cs b/MediaBrowser.Model/Entities/PackageReviewInfo.cs index c350935f40..52500a41ea 100644 --- a/MediaBrowser.Model/Entities/PackageReviewInfo.cs +++ b/MediaBrowser.Model/Entities/PackageReviewInfo.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace MediaBrowser.Model.Entities { diff --git a/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs b/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs new file mode 100644 index 0000000000..e10232baa9 --- /dev/null +++ b/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Model.Entities +{ + /// + /// Class ProviderIdsExtensions + /// + public static class ProviderIdsExtensions + { + /// + /// Determines whether [has provider identifier] [the specified instance]. + /// + /// The instance. + /// The provider. + /// true if [has provider identifier] [the specified instance]; otherwise, false. + public static bool HasProviderId(this IHasProviderIds instance, MetadataProviders provider) + { + return !string.IsNullOrEmpty(instance.GetProviderId(provider.ToString())); + } + + /// + /// Gets a provider id + /// + /// The instance. + /// The provider. + /// System.String. + public static string GetProviderId(this IHasProviderIds instance, MetadataProviders provider) + { + return instance.GetProviderId(provider.ToString()); + } + + /// + /// Gets a provider id + /// + /// The instance. + /// The name. + /// System.String. + public static string GetProviderId(this IHasProviderIds instance, string name) + { + if (instance == null) + { + throw new ArgumentNullException("instance"); + } + + if (instance.ProviderIds == null) + { + return null; + } + + string id; + instance.ProviderIds.TryGetValue(name, out id); + return id; + } + + /// + /// Sets a provider id + /// + /// The instance. + /// The name. + /// The value. + public static void SetProviderId(this IHasProviderIds instance, string name, string value) + { + if (instance == null) + { + throw new ArgumentNullException("instance"); + } + + // If it's null remove the key from the dictionary + if (string.IsNullOrEmpty(value)) + { + if (instance.ProviderIds != null) + { + if (instance.ProviderIds.ContainsKey(name)) + { + instance.ProviderIds.Remove(name); + } + } + } + else + { + // Ensure it exists + if (instance.ProviderIds == null) + { + instance.ProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase); + } + + instance.ProviderIds[name] = value; + } + } + + /// + /// Sets a provider id + /// + /// The instance. + /// The provider. + /// The value. + public static void SetProviderId(this IHasProviderIds instance, MetadataProviders provider, string value) + { + instance.SetProviderId(provider.ToString(), value); + } + } +} \ No newline at end of file diff --git a/MediaBrowser.Model/Entities/RequestResult.cs b/MediaBrowser.Model/Entities/RequestResult.cs deleted file mode 100644 index 5c9a725fd9..0000000000 --- a/MediaBrowser.Model/Entities/RequestResult.cs +++ /dev/null @@ -1,7 +0,0 @@ - -namespace MediaBrowser.Model.Entities -{ - public class EmptyRequestResult - { - } -} diff --git a/MediaBrowser.Model/Entities/ScrollDirection.cs b/MediaBrowser.Model/Entities/ScrollDirection.cs new file mode 100644 index 0000000000..ed22103003 --- /dev/null +++ b/MediaBrowser.Model/Entities/ScrollDirection.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Model.Entities +{ + /// + /// Enum ScrollDirection + /// + public enum ScrollDirection + { + /// + /// The horizontal + /// + Horizontal, + /// + /// The vertical + /// + Vertical + } +} \ No newline at end of file diff --git a/MediaBrowser.Model/Entities/SortOrder.cs b/MediaBrowser.Model/Entities/SortOrder.cs new file mode 100644 index 0000000000..5130449ba8 --- /dev/null +++ b/MediaBrowser.Model/Entities/SortOrder.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Model.Entities +{ + /// + /// Enum SortOrder + /// + public enum SortOrder + { + /// + /// The ascending + /// + Ascending, + /// + /// The descending + /// + Descending + } +} \ No newline at end of file diff --git a/MediaBrowser.Model/Entities/VideoSize.cs b/MediaBrowser.Model/Entities/VideoSize.cs new file mode 100644 index 0000000000..0100f3b904 --- /dev/null +++ b/MediaBrowser.Model/Entities/VideoSize.cs @@ -0,0 +1,8 @@ +namespace MediaBrowser.Model.Entities +{ + public enum VideoSize + { + StandardDefinition, + HighDefinition + } +} \ No newline at end of file diff --git a/MediaBrowser.Model/Entities/VideoType.cs b/MediaBrowser.Model/Entities/VideoType.cs index b2742add16..aa9a3c55f2 100644 --- a/MediaBrowser.Model/Entities/VideoType.cs +++ b/MediaBrowser.Model/Entities/VideoType.cs @@ -27,19 +27,4 @@ namespace MediaBrowser.Model.Entities /// HdDvd } - - /// - /// Enum IsoType - /// - public enum IsoType - { - /// - /// The DVD - /// - Dvd, - /// - /// The blu ray - /// - BluRay - } } -- cgit v1.2.3