aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpListenerHost.cs8
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpResultFactory.cs13
-rw-r--r--Emby.Server.Implementations/Library/LibraryManager.cs53
-rw-r--r--Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs4
4 files changed, 12 insertions, 66 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
index 86df798d0..0e68389da 100644
--- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
+++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
@@ -579,7 +579,13 @@ namespace Emby.Server.Implementations.HttpServer
catch (Exception ex)
{
- ErrorHandler(ex, httpReq, !string.Equals(ex.GetType().Name, "SocketException", StringComparison.OrdinalIgnoreCase));
+ var logException = !string.Equals(ex.GetType().Name, "SocketException", StringComparison.OrdinalIgnoreCase);
+
+#if DEBUG
+ logException = true;
+#endif
+
+ ErrorHandler(ex, httpReq, logException);
}
finally
{
diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
index b06a6a887..a70aad14e 100644
--- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
+++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
@@ -424,16 +424,6 @@ namespace Emby.Server.Implementations.HttpServer
options.ResponseHeaders = options.ResponseHeaders ?? new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
- if (!options.ResponseHeaders.ContainsKey("Content-Disposition"))
- {
- // Quotes are valid in linux. They'll possibly cause issues here
- var filename = (Path.GetFileName(path) ?? string.Empty).Replace("\"", string.Empty);
- if (!string.IsNullOrWhiteSpace(filename))
- {
- options.ResponseHeaders["Content-Disposition"] = "inline; filename=\"" + filename + "\"";
- }
- }
-
return GetStaticResult(requestContext, options);
}
@@ -490,7 +480,8 @@ namespace Emby.Server.Implementations.HttpServer
return result;
}
- var isHeadRequest = options.IsHeadRequest;
+ // TODO: We don't really need the option value
+ var isHeadRequest = options.IsHeadRequest || string.Equals(requestContext.Verb, "HEAD", StringComparison.OrdinalIgnoreCase);
var factoryFn = options.ContentFactory;
var responseHeaders = options.ResponseHeaders;
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index 5871e180e..85b91ac25 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -247,11 +247,6 @@ namespace Emby.Server.Implementations.Library
}
}
- /// <summary>
- /// The _season zero display name
- /// </summary>
- private string _seasonZeroDisplayName;
-
private bool _wizardCompleted;
/// <summary>
/// Records the configuration values.
@@ -259,7 +254,6 @@ namespace Emby.Server.Implementations.Library
/// <param name="configuration">The configuration.</param>
private void RecordConfigurationValues(ServerConfiguration configuration)
{
- _seasonZeroDisplayName = configuration.SeasonZeroDisplayName;
_wizardCompleted = configuration.IsStartupWizardCompleted;
}
@@ -272,59 +266,14 @@ namespace Emby.Server.Implementations.Library
{
var config = ConfigurationManager.Configuration;
- var newSeasonZeroName = ConfigurationManager.Configuration.SeasonZeroDisplayName;
- var seasonZeroNameChanged = !string.Equals(_seasonZeroDisplayName, newSeasonZeroName, StringComparison.Ordinal);
var wizardChanged = config.IsStartupWizardCompleted != _wizardCompleted;
RecordConfigurationValues(config);
- if (seasonZeroNameChanged || wizardChanged)
+ if (wizardChanged)
{
_taskManager.CancelIfRunningAndQueue<RefreshMediaLibraryTask>();
}
-
- if (seasonZeroNameChanged)
- {
- Task.Run(async () =>
- {
- await UpdateSeasonZeroNames(newSeasonZeroName, CancellationToken.None).ConfigureAwait(false);
-
- });
- }
- }
-
- /// <summary>
- /// Updates the season zero names.
- /// </summary>
- /// <param name="newName">The new name.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task.</returns>
- private async Task UpdateSeasonZeroNames(string newName, CancellationToken cancellationToken)
- {
- var seasons = GetItemList(new InternalItemsQuery
- {
- IncludeItemTypes = new[] { typeof(Season).Name },
- Recursive = true,
- IndexNumber = 0,
- DtoOptions = new DtoOptions(true)
-
- }).Cast<Season>()
- .Where(i => !string.Equals(i.Name, newName, StringComparison.Ordinal))
- .ToList();
-
- foreach (var season in seasons)
- {
- season.Name = newName;
-
- try
- {
- await UpdateItem(season, ItemUpdateType.MetadataDownload, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- _logger.ErrorException("Error saving {0}", ex, season.Path);
- }
- }
}
public void RegisterItem(BaseItem item)
diff --git a/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs b/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs
index bbe1bba85..a859d8ec8 100644
--- a/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs
+++ b/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs
@@ -55,9 +55,9 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
if (season.IndexNumber.HasValue)
{
var seasonNumber = season.IndexNumber.Value;
-
+
season.Name = seasonNumber == 0 ?
- _config.Configuration.SeasonZeroDisplayName :
+ args.LibraryOptions.SeasonZeroDisplayName :
string.Format(_localization.GetLocalizedString("NameSeasonNumber"), seasonNumber.ToString(UsCulture));
}