aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Channels/ChannelItemQuery.cs9
-rw-r--r--MediaBrowser.Model/Configuration/EncodingOptions.cs1
-rw-r--r--MediaBrowser.Model/Configuration/ServerConfiguration.cs1
-rw-r--r--MediaBrowser.Model/Dlna/DeviceProfile.cs3
-rw-r--r--MediaBrowser.Model/Dlna/ResolutionNormalizer.cs6
-rw-r--r--MediaBrowser.Model/Dlna/StreamBuilder.cs122
-rw-r--r--MediaBrowser.Model/Dto/UserDto.cs12
-rw-r--r--MediaBrowser.Model/LiveTv/LiveTvOptions.cs1
-rw-r--r--MediaBrowser.Model/LiveTv/ProgramQuery.cs14
-rw-r--r--MediaBrowser.Model/Net/HttpResponse.cs1
-rw-r--r--MediaBrowser.Model/Net/IAcceptSocket.cs3
-rw-r--r--MediaBrowser.Model/Net/ISocket.cs3
-rw-r--r--MediaBrowser.Model/Plugins/PluginPageInfo.cs4
-rw-r--r--MediaBrowser.Model/Services/IRequest.cs5
-rw-r--r--MediaBrowser.Model/Services/RouteAttribute.cs4
-rw-r--r--MediaBrowser.Model/System/SystemInfo.cs8
-rw-r--r--MediaBrowser.Model/Text/ITextEncoding.cs4
17 files changed, 137 insertions, 64 deletions
diff --git a/MediaBrowser.Model/Channels/ChannelItemQuery.cs b/MediaBrowser.Model/Channels/ChannelItemQuery.cs
index 4aacc1619..909d35b38 100644
--- a/MediaBrowser.Model/Channels/ChannelItemQuery.cs
+++ b/MediaBrowser.Model/Channels/ChannelItemQuery.cs
@@ -1,4 +1,6 @@
-using MediaBrowser.Model.Entities;
+using System;
+using System.Collections.Generic;
+using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
namespace MediaBrowser.Model.Channels
@@ -35,16 +37,15 @@ namespace MediaBrowser.Model.Channels
/// <value>The limit.</value>
public int? Limit { get; set; }
- public SortOrder? SortOrder { get; set; }
- public string[] SortBy { get; set; }
public ItemFilter[] Filters { get; set; }
public ItemFields[] Fields { get; set; }
+ public Tuple<string, SortOrder>[] OrderBy { get; set; }
public ChannelItemQuery()
{
Filters = new ItemFilter[] { };
- SortBy = new string[] { };
Fields = new ItemFields[] { };
+ OrderBy = new Tuple<string, SortOrder>[] { };
}
}
diff --git a/MediaBrowser.Model/Configuration/EncodingOptions.cs b/MediaBrowser.Model/Configuration/EncodingOptions.cs
index b093d82e3..a143bb9e3 100644
--- a/MediaBrowser.Model/Configuration/EncodingOptions.cs
+++ b/MediaBrowser.Model/Configuration/EncodingOptions.cs
@@ -13,6 +13,7 @@ namespace MediaBrowser.Model.Configuration
public string VaapiDevice { get; set; }
public int H264Crf { get; set; }
public string H264Preset { get; set; }
+ public string DeinterlaceMethod { get; set; }
public bool EnableHardwareEncoding { get; set; }
public bool EnableSubtitleExtraction { get; set; }
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
index 5177a757a..ae04bbaab 100644
--- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
@@ -179,7 +179,6 @@ namespace MediaBrowser.Model.Configuration
public int SchemaVersion { get; set; }
public bool EnableAnonymousUsageReporting { get; set; }
- public bool EnableStandaloneMusicKeys { get; set; }
public bool EnableFolderView { get; set; }
public bool EnableGroupingIntoCollections { get; set; }
public bool DisplaySpecialsWithinSeasons { get; set; }
diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.cs
index d6f0eafc7..fc976b605 100644
--- a/MediaBrowser.Model/Dlna/DeviceProfile.cs
+++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs
@@ -17,9 +17,6 @@ namespace MediaBrowser.Model.Dlna
[XmlIgnore]
public string Id { get; set; }
- [XmlIgnore]
- public MediaBrowser.Model.Dlna.DeviceProfileType ProfileType { get; set; }
-
/// <summary>
/// Gets or sets the identification.
/// </summary>
diff --git a/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs b/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs
index ae74e255b..de832314c 100644
--- a/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs
+++ b/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs
@@ -58,12 +58,16 @@ namespace MediaBrowser.Model.Dlna
private static ResolutionConfiguration GetResolutionConfiguration(int outputBitrate)
{
+ ResolutionConfiguration previousOption = null;
+
foreach (var config in Configurations)
{
if (outputBitrate <= config.MaxBitrate)
{
- return config;
+ return previousOption ?? config;
}
+
+ previousOption = config;
}
return null;
diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs
index 10c6a05c0..a5ec0f26c 100644
--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs
+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs
@@ -849,8 +849,6 @@ namespace MediaBrowser.Model.Dlna
}
}
}
- ApplyTranscodingConditions(playlistItem, audioTranscodingConditions);
-
// Honor requested max channels
if (options.MaxAudioChannels.HasValue)
{
@@ -878,6 +876,9 @@ namespace MediaBrowser.Model.Dlna
var longBitrate = Math.Max(Math.Min(videoBitrate, currentValue), 64000);
playlistItem.VideoBitrate = longBitrate > int.MaxValue ? int.MaxValue : Convert.ToInt32(longBitrate);
}
+
+ // Do this after initial values are set to account for greater than/less than conditions
+ ApplyTranscodingConditions(playlistItem, audioTranscodingConditions);
}
playlistItem.TranscodeReasons = transcodeReasons;
@@ -1430,7 +1431,18 @@ namespace MediaBrowser.Model.Dlna
int num;
if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num))
{
- item.AudioBitrate = num;
+ if (condition.Condition == ProfileConditionType.Equals)
+ {
+ item.AudioBitrate = num;
+ }
+ else if (condition.Condition == ProfileConditionType.LessThanEqual)
+ {
+ item.AudioBitrate = Math.Min(num, item.AudioBitrate ?? num);
+ }
+ else if (condition.Condition == ProfileConditionType.GreaterThanEqual)
+ {
+ item.AudioBitrate = Math.Max(num, item.AudioBitrate ?? num);
+ }
}
break;
}
@@ -1439,7 +1451,18 @@ namespace MediaBrowser.Model.Dlna
int num;
if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num))
{
- item.MaxAudioChannels = num;
+ if (condition.Condition == ProfileConditionType.Equals)
+ {
+ item.MaxAudioChannels = num;
+ }
+ else if (condition.Condition == ProfileConditionType.LessThanEqual)
+ {
+ item.MaxAudioChannels = Math.Min(num, item.MaxAudioChannels ?? num);
+ }
+ else if (condition.Condition == ProfileConditionType.GreaterThanEqual)
+ {
+ item.MaxAudioChannels = Math.Max(num, item.MaxAudioChannels ?? num);
+ }
}
break;
}
@@ -1507,7 +1530,18 @@ namespace MediaBrowser.Model.Dlna
int num;
if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num))
{
- item.MaxRefFrames = num;
+ if (condition.Condition == ProfileConditionType.Equals)
+ {
+ item.MaxRefFrames = num;
+ }
+ else if (condition.Condition == ProfileConditionType.LessThanEqual)
+ {
+ item.MaxRefFrames = Math.Min(num, item.MaxRefFrames ?? num);
+ }
+ else if (condition.Condition == ProfileConditionType.GreaterThanEqual)
+ {
+ item.MaxRefFrames = Math.Max(num, item.MaxRefFrames ?? num);
+ }
}
break;
}
@@ -1516,7 +1550,18 @@ namespace MediaBrowser.Model.Dlna
int num;
if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num))
{
- item.MaxVideoBitDepth = num;
+ if (condition.Condition == ProfileConditionType.Equals)
+ {
+ item.MaxVideoBitDepth = num;
+ }
+ else if (condition.Condition == ProfileConditionType.LessThanEqual)
+ {
+ item.MaxVideoBitDepth = Math.Min(num, item.MaxVideoBitDepth ?? num);
+ }
+ else if (condition.Condition == ProfileConditionType.GreaterThanEqual)
+ {
+ item.MaxVideoBitDepth = Math.Max(num, item.MaxVideoBitDepth ?? num);
+ }
}
break;
}
@@ -1530,7 +1575,18 @@ namespace MediaBrowser.Model.Dlna
int num;
if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num))
{
- item.MaxHeight = num;
+ if (condition.Condition == ProfileConditionType.Equals)
+ {
+ item.MaxHeight = num;
+ }
+ else if (condition.Condition == ProfileConditionType.LessThanEqual)
+ {
+ item.MaxHeight = Math.Min(num, item.MaxHeight ?? num);
+ }
+ else if (condition.Condition == ProfileConditionType.GreaterThanEqual)
+ {
+ item.MaxHeight = Math.Max(num, item.MaxHeight ?? num);
+ }
}
break;
}
@@ -1539,7 +1595,18 @@ namespace MediaBrowser.Model.Dlna
int num;
if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num))
{
- item.VideoBitrate = num;
+ if (condition.Condition == ProfileConditionType.Equals)
+ {
+ item.VideoBitrate = num;
+ }
+ else if (condition.Condition == ProfileConditionType.LessThanEqual)
+ {
+ item.VideoBitrate = Math.Min(num, item.VideoBitrate ?? num);
+ }
+ else if (condition.Condition == ProfileConditionType.GreaterThanEqual)
+ {
+ item.VideoBitrate = Math.Max(num, item.VideoBitrate ?? num);
+ }
}
break;
}
@@ -1548,7 +1615,18 @@ namespace MediaBrowser.Model.Dlna
float num;
if (float.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num))
{
- item.MaxFramerate = num;
+ if (condition.Condition == ProfileConditionType.Equals)
+ {
+ item.MaxFramerate = num;
+ }
+ else if (condition.Condition == ProfileConditionType.LessThanEqual)
+ {
+ item.MaxFramerate = Math.Min(num, item.MaxFramerate ?? num);
+ }
+ else if (condition.Condition == ProfileConditionType.GreaterThanEqual)
+ {
+ item.MaxFramerate = Math.Max(num, item.MaxFramerate ?? num);
+ }
}
break;
}
@@ -1557,7 +1635,18 @@ namespace MediaBrowser.Model.Dlna
int num;
if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num))
{
- item.VideoLevel = num;
+ if (condition.Condition == ProfileConditionType.Equals)
+ {
+ item.VideoLevel = num;
+ }
+ else if (condition.Condition == ProfileConditionType.LessThanEqual)
+ {
+ item.VideoLevel = Math.Min(num, item.VideoLevel ?? num);
+ }
+ else if (condition.Condition == ProfileConditionType.GreaterThanEqual)
+ {
+ item.VideoLevel = Math.Max(num, item.VideoLevel ?? num);
+ }
}
break;
}
@@ -1566,7 +1655,18 @@ namespace MediaBrowser.Model.Dlna
int num;
if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num))
{
- item.MaxWidth = num;
+ if (condition.Condition == ProfileConditionType.Equals)
+ {
+ item.MaxWidth = num;
+ }
+ else if (condition.Condition == ProfileConditionType.LessThanEqual)
+ {
+ item.MaxWidth = Math.Min(num, item.MaxWidth ?? num);
+ }
+ else if (condition.Condition == ProfileConditionType.GreaterThanEqual)
+ {
+ item.MaxWidth = Math.Max(num, item.MaxWidth ?? num);
+ }
}
break;
}
diff --git a/MediaBrowser.Model/Dto/UserDto.cs b/MediaBrowser.Model/Dto/UserDto.cs
index 99f69e203..2b5672896 100644
--- a/MediaBrowser.Model/Dto/UserDto.cs
+++ b/MediaBrowser.Model/Dto/UserDto.cs
@@ -55,18 +55,6 @@ namespace MediaBrowser.Model.Dto
public string Id { get; set; }
/// <summary>
- /// Gets or sets the offline password.
- /// </summary>
- /// <value>The offline password.</value>
- public string OfflinePassword { get; set; }
-
- /// <summary>
- /// Gets or sets the offline password salt.
- /// </summary>
- /// <value>The offline password salt.</value>
- public string OfflinePasswordSalt { get; set; }
-
- /// <summary>
/// Gets or sets the primary image tag.
/// </summary>
/// <value>The primary image tag.</value>
diff --git a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs
index 2c2f22e86..a70a1066d 100644
--- a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs
+++ b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs
@@ -33,7 +33,6 @@ namespace MediaBrowser.Model.LiveTv
MediaLocationsCreated = new string[] { };
RecordingEncodingFormat = "mkv";
RecordingPostProcessorArguments = "\"{path}\"";
- EnableRecordingEncoding = true;
}
}
diff --git a/MediaBrowser.Model/LiveTv/ProgramQuery.cs b/MediaBrowser.Model/LiveTv/ProgramQuery.cs
index 1fd995760..c0959635f 100644
--- a/MediaBrowser.Model/LiveTv/ProgramQuery.cs
+++ b/MediaBrowser.Model/LiveTv/ProgramQuery.cs
@@ -12,7 +12,7 @@ namespace MediaBrowser.Model.LiveTv
public ProgramQuery()
{
ChannelIds = new string[] { };
- SortBy = new string[] { };
+ OrderBy = new Tuple<string, SortOrder>[] { };
Genres = new string[] { };
EnableTotalRecordCount = true;
EnableUserData = true;
@@ -104,17 +104,7 @@ namespace MediaBrowser.Model.LiveTv
/// </summary>
public int? Limit { get; set; }
- /// <summary>
- /// What to sort the results by
- /// </summary>
- /// <value>The sort by.</value>
- public string[] SortBy { get; set; }
-
- /// <summary>
- /// The sort order to return results with
- /// </summary>
- /// <value>The sort order.</value>
- public SortOrder? SortOrder { get; set; }
+ public Tuple<string, SortOrder>[] OrderBy { get; set; }
/// <summary>
/// Limit results to items containing specific genres
diff --git a/MediaBrowser.Model/Net/HttpResponse.cs b/MediaBrowser.Model/Net/HttpResponse.cs
index f4bd8e681..7c3d1d73d 100644
--- a/MediaBrowser.Model/Net/HttpResponse.cs
+++ b/MediaBrowser.Model/Net/HttpResponse.cs
@@ -59,6 +59,7 @@ namespace MediaBrowser.Model.Net
{
_disposable.Dispose();
}
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/MediaBrowser.Model/Net/IAcceptSocket.cs b/MediaBrowser.Model/Net/IAcceptSocket.cs
index 2b5d33dce..343e12ab6 100644
--- a/MediaBrowser.Model/Net/IAcceptSocket.cs
+++ b/MediaBrowser.Model/Net/IAcceptSocket.cs
@@ -12,9 +12,6 @@ namespace MediaBrowser.Model.Net
void Listen(int backlog);
void Bind(IpEndPointInfo endpoint);
void Connect(IpEndPointInfo endPoint);
- void StartAccept(Action<IAcceptSocket> onAccept, Func<bool> isClosed);
- IAsyncResult BeginSendFile(string path, byte[] preBuffer, byte[] postBuffer, AsyncCallback callback, object state);
- void EndSendFile(IAsyncResult result);
}
public class SocketCreateException : Exception
diff --git a/MediaBrowser.Model/Net/ISocket.cs b/MediaBrowser.Model/Net/ISocket.cs
index 42550340b..6a6781026 100644
--- a/MediaBrowser.Model/Net/ISocket.cs
+++ b/MediaBrowser.Model/Net/ISocket.cs
@@ -24,8 +24,5 @@ namespace MediaBrowser.Model.Net
/// Sends a UDP message to a particular end point (uni or multicast).
/// </summary>
Task SendToAsync(byte[] buffer, int offset, int bytes, IpEndPointInfo endPoint, CancellationToken cancellationToken);
-
- IAsyncResult BeginSendTo(byte[] buffer, int offset, int size, IpEndPointInfo endPoint, AsyncCallback callback, object state);
- int EndSendTo(IAsyncResult result);
}
} \ No newline at end of file
diff --git a/MediaBrowser.Model/Plugins/PluginPageInfo.cs b/MediaBrowser.Model/Plugins/PluginPageInfo.cs
index 4b91e0791..64cdb31f8 100644
--- a/MediaBrowser.Model/Plugins/PluginPageInfo.cs
+++ b/MediaBrowser.Model/Plugins/PluginPageInfo.cs
@@ -4,6 +4,10 @@
{
public string Name { get; set; }
+ public string DisplayName { get; set; }
+
public string EmbeddedResourcePath { get; set; }
+
+ public bool EnableInMainMenu { get; set; }
}
}
diff --git a/MediaBrowser.Model/Services/IRequest.cs b/MediaBrowser.Model/Services/IRequest.cs
index f056c7410..5a895815e 100644
--- a/MediaBrowser.Model/Services/IRequest.cs
+++ b/MediaBrowser.Model/Services/IRequest.cs
@@ -49,11 +49,6 @@ namespace MediaBrowser.Model.Services
string ResponseContentType { get; set; }
/// <summary>
- /// Whether the ResponseContentType has been explicitly overrided or whether it was just the default
- /// </summary>
- bool HasExplicitResponseContentType { get; }
-
- /// <summary>
/// Attach any data to this request that all filters and services can access.
/// </summary>
Dictionary<string, object> Items { get; }
diff --git a/MediaBrowser.Model/Services/RouteAttribute.cs b/MediaBrowser.Model/Services/RouteAttribute.cs
index 5a39688da..264500e60 100644
--- a/MediaBrowser.Model/Services/RouteAttribute.cs
+++ b/MediaBrowser.Model/Services/RouteAttribute.cs
@@ -88,6 +88,10 @@ namespace MediaBrowser.Model.Services
/// </summary>
public string Summary { get; set; }
+ public string Description { get; set; }
+
+ public bool IsHidden { get; set; }
+
/// <summary>
/// Gets or sets longer text to explain the behaviour of the route.
/// </summary>
diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs
index fce9dea4f..b61d63729 100644
--- a/MediaBrowser.Model/System/SystemInfo.cs
+++ b/MediaBrowser.Model/System/SystemInfo.cs
@@ -17,12 +17,6 @@ namespace MediaBrowser.Model.System
public string OperatingSystemDisplayName { get; set; }
/// <summary>
- /// Gets or sets a value indicating whether [supports running as service].
- /// </summary>
- /// <value><c>true</c> if [supports running as service]; otherwise, <c>false</c>.</value>
- public bool SupportsRunningAsService { get; set; }
-
- /// <summary>
/// Gets or sets the mac address.
/// </summary>
/// <value>The mac address.</value>
@@ -36,6 +30,8 @@ namespace MediaBrowser.Model.System
/// <value><c>true</c> if this instance has pending restart; otherwise, <c>false</c>.</value>
public bool HasPendingRestart { get; set; }
+ public bool IsShuttingDown { get; set; }
+
/// <summary>
/// Gets or sets a value indicating whether [supports library monitor].
/// </summary>
diff --git a/MediaBrowser.Model/Text/ITextEncoding.cs b/MediaBrowser.Model/Text/ITextEncoding.cs
index 96dca0c04..619d90a2b 100644
--- a/MediaBrowser.Model/Text/ITextEncoding.cs
+++ b/MediaBrowser.Model/Text/ITextEncoding.cs
@@ -7,8 +7,8 @@ namespace MediaBrowser.Model.Text
{
Encoding GetASCIIEncoding();
- string GetDetectedEncodingName(byte[] bytes, string language, bool enableLanguageDetection);
- Encoding GetDetectedEncoding(byte[] bytes, string language, bool enableLanguageDetection);
+ string GetDetectedEncodingName(byte[] bytes, int size, string language, bool enableLanguageDetection);
+ Encoding GetDetectedEncoding(byte[] bytes, int size, string language, bool enableLanguageDetection);
Encoding GetEncodingFromCharset(string charset);
}
}