aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-01-18 23:29:57 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-01-18 23:29:57 -0500
commitde76156391655f726b5655f727e06822398827ca (patch)
treef7ae5e4af806744aaa34136ba47648dd2e412a02 /MediaBrowser.Controller
parent1316994324b178650e6bb9ddca740d9159d316d1 (diff)
rework hosting options
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Entities/Movies/BoxSet.cs26
-rw-r--r--MediaBrowser.Controller/IServerApplicationHost.cs14
-rw-r--r--MediaBrowser.Controller/Net/IHttpServer.cs7
3 files changed, 45 insertions, 2 deletions
diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs
index 4483c7b0f2..e48b8d8457 100644
--- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs
+++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs
@@ -1,4 +1,5 @@
using MediaBrowser.Common.Progress;
+using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
@@ -93,6 +94,31 @@ namespace MediaBrowser.Controller.Entities.Movies
return list;
}
+ /// <summary>
+ /// Updates the official rating based on content and returns true or false indicating if it changed.
+ /// </summary>
+ /// <returns></returns>
+ public bool UpdateRatingToContent()
+ {
+ var currentOfficialRating = OfficialRating;
+
+ // Gather all possible ratings
+ var ratings = RecursiveChildren
+ .Concat(GetLinkedChildren())
+ .Where(i => i is Movie || i is Series)
+ .Select(i => i.OfficialRating)
+ .Where(i => !string.IsNullOrEmpty(i))
+ .Distinct(StringComparer.OrdinalIgnoreCase)
+ .Select(i => new Tuple<string, int?>(i, LocalizationManager.GetRatingLevel(i)))
+ .OrderBy(i => i.Item2 ?? 1000)
+ .Select(i => i.Item1);
+
+ OfficialRating = ratings.FirstOrDefault() ?? currentOfficialRating;
+
+ return !string.Equals(currentOfficialRating ?? string.Empty, OfficialRating ?? string.Empty,
+ StringComparison.OrdinalIgnoreCase);
+ }
+
public override IEnumerable<BaseItem> GetChildren(User user, bool includeLinkedChildren)
{
var children = base.GetChildren(user, includeLinkedChildren);
diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.cs
index 181c14debe..0b0f6d8287 100644
--- a/MediaBrowser.Controller/IServerApplicationHost.cs
+++ b/MediaBrowser.Controller/IServerApplicationHost.cs
@@ -28,7 +28,19 @@ namespace MediaBrowser.Controller
/// Gets the HTTP server port.
/// </summary>
/// <value>The HTTP server port.</value>
- int HttpServerPort { get; }
+ int HttpPort { get; }
+
+ /// <summary>
+ /// Gets the HTTPS port.
+ /// </summary>
+ /// <value>The HTTPS port.</value>
+ int HttpsPort { get; }
+
+ /// <summary>
+ /// Gets a value indicating whether [supports HTTPS].
+ /// </summary>
+ /// <value><c>true</c> if [supports HTTPS]; otherwise, <c>false</c>.</value>
+ bool EnableHttps { get; }
/// <summary>
/// Gets a value indicating whether this instance has update available.
diff --git a/MediaBrowser.Controller/Net/IHttpServer.cs b/MediaBrowser.Controller/Net/IHttpServer.cs
index d56bee009e..315b48b837 100644
--- a/MediaBrowser.Controller/Net/IHttpServer.cs
+++ b/MediaBrowser.Controller/Net/IHttpServer.cs
@@ -1,4 +1,3 @@
-using MediaBrowser.Common.Net;
using System;
using System.Collections.Generic;
@@ -16,6 +15,12 @@ namespace MediaBrowser.Controller.Net
IEnumerable<string> UrlPrefixes { get; }
/// <summary>
+ /// Gets the certificate path.
+ /// </summary>
+ /// <value>The certificate path.</value>
+ string CertificatePath { get; }
+
+ /// <summary>
/// Starts the specified server name.
/// </summary>
/// <param name="urlPrefixes">The URL prefixes.</param>