diff --git a/Emby.Server.Implementations/Data/SqliteExtensions.cs b/Emby.Server.Implementations/Data/SqliteExtensions.cs
index d1df93011..c76ae0cac 100644
--- a/Emby.Server.Implementations/Data/SqliteExtensions.cs
+++ b/Emby.Server.Implementations/Data/SqliteExtensions.cs
@@ -9,6 +9,9 @@ namespace Emby.Server.Implementations.Data
{
public static class SqliteExtensions
{
+ private const string DatetimeFormatUtc = "yyyy-MM-dd HH:mm:ss.FFFFFFFK";
+ private const string DatetimeFormatLocal = "yyyy-MM-dd HH:mm:ss.FFFFFFF";
+
///
/// An array of ISO-8601 DateTime formats that we support parsing.
///
@@ -19,7 +22,7 @@ namespace Emby.Server.Implementations.Data
"HH:mm:ss.FFFFFFFK",
"HH:mm:ssK",
"HH:mmK",
- "yyyy-MM-dd HH:mm:ss.FFFFFFFK", /* NOTE: UTC default (5). */
+ DatetimeFormatUtc,
"yyyy-MM-dd HH:mm:ssK",
"yyyy-MM-dd HH:mmK",
"yyyy-MM-ddTHH:mm:ss.FFFFFFFK",
@@ -33,7 +36,7 @@ namespace Emby.Server.Implementations.Data
"HH:mm:ss.FFFFFFF",
"HH:mm:ss",
"HH:mm",
- "yyyy-MM-dd HH:mm:ss.FFFFFFF", /* NOTE: Non-UTC default (19). */
+ DatetimeFormatLocal,
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-dd HH:mm",
"yyyy-MM-ddTHH:mm:ss.FFFFFFF",
@@ -47,9 +50,6 @@ namespace Emby.Server.Implementations.Data
"yy-MM-dd"
};
- private static readonly string _datetimeFormatUtc = _datetimeFormats[5];
- private static readonly string _datetimeFormatLocal = _datetimeFormats[19];
-
public static void RunQueries(this SQLiteDatabaseConnection connection, string[] queries)
{
if (queries == null)
@@ -82,7 +82,7 @@ namespace Emby.Server.Implementations.Data
}
private static string GetDateTimeKindFormat(DateTimeKind kind)
- => (kind == DateTimeKind.Utc) ? _datetimeFormatUtc : _datetimeFormatLocal;
+ => (kind == DateTimeKind.Utc) ? DatetimeFormatUtc : DatetimeFormatLocal;
public static DateTime ReadDateTime(this IResultSetValue result)
{
diff --git a/MediaBrowser.Providers/Subtitles/SubtitleManager.cs b/MediaBrowser.Providers/Subtitles/SubtitleManager.cs
index c6199399d..37d1230e2 100644
--- a/MediaBrowser.Providers/Subtitles/SubtitleManager.cs
+++ b/MediaBrowser.Providers/Subtitles/SubtitleManager.cs
@@ -54,7 +54,7 @@ namespace MediaBrowser.Providers.Subtitles
public void AddParts(IEnumerable subtitleProviders)
{
_subtitleProviders = subtitleProviders
- .OrderBy(i => !(i is IHasOrder hasOrder) ? 0 : hasOrder.Order)
+ .OrderBy(i => i is IHasOrder hasOrder ? hasOrder.Order : 0)
.ToArray();
}
diff --git a/MediaBrowser.Providers/TV/DummySeasonProvider.cs b/MediaBrowser.Providers/TV/DummySeasonProvider.cs
index 8b5e6aaba..574f6cd63 100644
--- a/MediaBrowser.Providers/TV/DummySeasonProvider.cs
+++ b/MediaBrowser.Providers/TV/DummySeasonProvider.cs
@@ -127,14 +127,22 @@ namespace MediaBrowser.Providers.TV
bool isVirtualItem,
CancellationToken cancellationToken)
{
- var seasonName = seasonNumber == 0
- ? _libraryManager.GetLibraryOptions(series).SeasonZeroDisplayName
- : (seasonNumber.HasValue
- ? string.Format(
- CultureInfo.InvariantCulture,
- _localization.GetLocalizedString("NameSeasonNumber"),
- seasonNumber.Value)
- : _localization.GetLocalizedString("NameSeasonUnknown"));
+ string seasonName;
+ if (seasonNumber == null)
+ {
+ seasonName =_localization.GetLocalizedString("NameSeasonUnknown")
+ }
+ else if (seasonNumber == 0)
+ {
+ seasonName = _libraryManager.GetLibraryOptions(series).SeasonZeroDisplayName;
+ }
+ else
+ {
+ seasonName = string.Format(
+ CultureInfo.InvariantCulture,
+ _localization.GetLocalizedString("NameSeasonNumber"),
+ seasonNumber.Value);
+ }
_logger.LogInformation("Creating Season {0} entry for {1}", seasonName, series.Name);