aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
authorOrry Verducci <orry@orryverducci.co.uk>2020-08-10 22:17:13 +0100
committerOrry Verducci <orry@orryverducci.co.uk>2020-08-10 22:17:13 +0100
commit2d6699fd470ba1f0fcabac9df4d5184205e0e351 (patch)
treeaa0f078df01baa798435ae25f3d5ee4945f7f501 /MediaBrowser.Model
parentce51775e7426ff4e037d593715395684ebf9b08a (diff)
parentb82a3fee85298a1063069cae5ff4df3029e468b0 (diff)
Merge remote-tracking branch 'upstream/master' into deinterlace-improvements
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs8
-rw-r--r--MediaBrowser.Model/Configuration/ServerConfiguration.cs13
-rw-r--r--MediaBrowser.Model/Dlna/SortCriteria.cs2
-rw-r--r--MediaBrowser.Model/Entities/DisplayPreferencesDto.cs (renamed from MediaBrowser.Model/Entities/DisplayPreferences.cs)12
-rw-r--r--MediaBrowser.Model/Entities/MediaStream.cs4
-rw-r--r--MediaBrowser.Model/Entities/ScrollDirection.cs18
-rw-r--r--MediaBrowser.Model/Entities/SortOrder.cs18
-rw-r--r--MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs2
-rw-r--r--MediaBrowser.Model/LiveTv/SeriesTimerQuery.cs2
9 files changed, 29 insertions, 50 deletions
diff --git a/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs
index 66f3e1a94b..b00d2fffb7 100644
--- a/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs
@@ -52,7 +52,13 @@ namespace MediaBrowser.Model.Configuration
public string PreviousVersionStr
{
get => PreviousVersion?.ToString();
- set => PreviousVersion = Version.Parse(value);
+ set
+ {
+ if (Version.TryParse(value, out var version))
+ {
+ PreviousVersion = version;
+ }
+ }
}
}
}
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
index a0c21a666c..c66091f9d5 100644
--- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
@@ -255,6 +255,16 @@ namespace MediaBrowser.Model.Configuration
public string[] UninstalledPlugins { get; set; }
/// <summary>
+ /// Gets or sets a value indicating whether slow server responses should be logged as a warning.
+ /// </summary>
+ public bool EnableSlowResponseWarning { get; set; }
+
+ /// <summary>
+ /// Gets or sets the threshold for the slow response time warning in ms.
+ /// </summary>
+ public long SlowResponseThresholdMs { get; set; }
+
+ /// <summary>
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
/// </summary>
public ServerConfiguration()
@@ -359,6 +369,9 @@ namespace MediaBrowser.Model.Configuration
DisabledImageFetchers = new[] { "The Open Movie Database", "TheMovieDb" }
}
};
+
+ EnableSlowResponseWarning = true;
+ SlowResponseThresholdMs = 500;
}
}
diff --git a/MediaBrowser.Model/Dlna/SortCriteria.cs b/MediaBrowser.Model/Dlna/SortCriteria.cs
index 1f7fa76ade..53e4540cbb 100644
--- a/MediaBrowser.Model/Dlna/SortCriteria.cs
+++ b/MediaBrowser.Model/Dlna/SortCriteria.cs
@@ -1,6 +1,6 @@
#pragma warning disable CS1591
-using MediaBrowser.Model.Entities;
+using Jellyfin.Data.Enums;
namespace MediaBrowser.Model.Dlna
{
diff --git a/MediaBrowser.Model/Entities/DisplayPreferences.cs b/MediaBrowser.Model/Entities/DisplayPreferencesDto.cs
index 7e5c5be3b6..1f7fe30300 100644
--- a/MediaBrowser.Model/Entities/DisplayPreferences.cs
+++ b/MediaBrowser.Model/Entities/DisplayPreferencesDto.cs
@@ -1,22 +1,18 @@
#nullable disable
using System.Collections.Generic;
+using Jellyfin.Data.Enums;
namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Defines the display preferences for any item that supports them (usually Folders).
/// </summary>
- public class DisplayPreferences
+ public class DisplayPreferencesDto
{
/// <summary>
- /// The image scale.
+ /// Initializes a new instance of the <see cref="DisplayPreferencesDto" /> class.
/// </summary>
- private const double ImageScale = .9;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="DisplayPreferences" /> class.
- /// </summary>
- public DisplayPreferences()
+ public DisplayPreferencesDto()
{
RememberIndexing = false;
PrimaryImageHeight = 250;
diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs
index 1b37cfc939..f9ec0d2388 100644
--- a/MediaBrowser.Model/Entities/MediaStream.cs
+++ b/MediaBrowser.Model/Entities/MediaStream.cs
@@ -233,7 +233,7 @@ namespace MediaBrowser.Model.Entities
if (!string.IsNullOrEmpty(Title))
{
- var result = new StringBuilder(Title);
+ var result = new StringBuilder(Title);
foreach (var tag in attributes)
{
// Keep Tags that are not already in Title.
@@ -246,7 +246,7 @@ namespace MediaBrowser.Model.Entities
return result.ToString();
}
- return string.Join(" - ", attributes.ToArray());
+ return string.Join(" - ", attributes);
}
default:
diff --git a/MediaBrowser.Model/Entities/ScrollDirection.cs b/MediaBrowser.Model/Entities/ScrollDirection.cs
deleted file mode 100644
index a1de0edcbb..0000000000
--- a/MediaBrowser.Model/Entities/ScrollDirection.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace MediaBrowser.Model.Entities
-{
- /// <summary>
- /// Enum ScrollDirection.
- /// </summary>
- public enum ScrollDirection
- {
- /// <summary>
- /// The horizontal.
- /// </summary>
- Horizontal,
-
- /// <summary>
- /// The vertical.
- /// </summary>
- Vertical
- }
-}
diff --git a/MediaBrowser.Model/Entities/SortOrder.cs b/MediaBrowser.Model/Entities/SortOrder.cs
deleted file mode 100644
index f3abc06f33..0000000000
--- a/MediaBrowser.Model/Entities/SortOrder.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace MediaBrowser.Model.Entities
-{
- /// <summary>
- /// Enum SortOrder.
- /// </summary>
- public enum SortOrder
- {
- /// <summary>
- /// The ascending.
- /// </summary>
- Ascending,
-
- /// <summary>
- /// The descending.
- /// </summary>
- Descending
- }
-}
diff --git a/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs b/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs
index 2b2377fdaf..ab74aff28b 100644
--- a/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs
+++ b/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs
@@ -2,7 +2,7 @@
#pragma warning disable CS1591
using System;
-using MediaBrowser.Model.Entities;
+using Jellyfin.Data.Enums;
namespace MediaBrowser.Model.LiveTv
{
diff --git a/MediaBrowser.Model/LiveTv/SeriesTimerQuery.cs b/MediaBrowser.Model/LiveTv/SeriesTimerQuery.cs
index b899a464b4..dae885775c 100644
--- a/MediaBrowser.Model/LiveTv/SeriesTimerQuery.cs
+++ b/MediaBrowser.Model/LiveTv/SeriesTimerQuery.cs
@@ -1,6 +1,6 @@
#pragma warning disable CS1591
-using MediaBrowser.Model.Entities;
+using Jellyfin.Data.Enums;
namespace MediaBrowser.Model.LiveTv
{