Skip to content

The Free Software Media System - Server Backend & API

Merge branch 'master' into release-10.3.z

Bond-00982f041d050f9
diff --cc Emby.Server.Implementations/ApplicationHost.cs
index c64922a931,3aa2dbf9a6..120aade392
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@@ -1718,10 -1690,10 +1689,8 @@@ namespace Emby.Server.Implementation
LogErrors = LogPing,
LogRequest = LogPing,
BufferContent = false,
--
CancellationToken = cancellationToken
-
}, HttpMethod.Post).ConfigureAwait(false))
-
{
using (var reader = new StreamReader(response.Content))
{
diff --cc Emby.Server.Implementations/Data/BaseSqliteRepository.cs
index aea37ffb17,9bc0bb9456..919453d2a4
--- a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs
+++ b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs
@@@ -199,42 -157,33 +157,35 @@@ namespace Emby.Server.Implementations.D
}, ReadTransactionMode);
}
- protected void RunDefaultInitialization(ManagedConnection db)
+ protected List<string> GetColumnNames(IDatabaseConnection connection, string table)
{
- var queries = new List<string>
- {
- "PRAGMA journal_mode=WAL",
- "PRAGMA page_size=4096",
- "PRAGMA synchronous=Normal"
- };
+ var columnNames = new List<string>();
- if (EnableTempStoreMemory)
- {
- queries.AddRange(new List<string>
- {
- "pragma default_temp_store = memory",
- "pragma temp_store = memory"
- });
- }
- else
+ foreach (var row in connection.Query("PRAGMA table_info(" + table + ")"))
{
- queries.AddRange(new List<string>
+ if (row[1].SQLiteType != SQLiteType.Null)
{
- "pragma temp_store = file"
- });
+ var name = row[1].ToString();
+
+ columnNames.Add(name);
+ }
}
+ // Configuration and pragmas can affect VACUUM so it needs to be last.
+ queries.Add("VACUUM");
- db.ExecuteAll(string.Join(";", queries));
- Logger.LogInformation("PRAGMA synchronous=" + db.Query("PRAGMA synchronous").SelectScalarString().First());
+ return columnNames;
}
- protected virtual bool EnableTempStoreMemory => false;
+ protected void AddColumn(IDatabaseConnection connection, string table, string columnName, string type, List<string> existingColumnNames)
+ {
+ if (existingColumnNames.Contains(columnName, StringComparer.OrdinalIgnoreCase))
+ {
+ return;
+ }
- protected virtual int? CacheSize => null;
+ connection.Execute("alter table " + table + " add column " + columnName + " " + type + " NULL");
+ }
- private bool _disposed;
protected void CheckDisposed()
{
if (_disposed)
diff --cc Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs
index 60c914898c,e8b34da0ca..7de9931c76
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs
@@@ -46,8 -46,8 +46,7 @@@ namespace Emby.Server.Implementations.L
Url = url,
CancellationToken = CancellationToken.None,
BufferContent = false,
--
- DecompressionMethod = CompressionMethod.None,
- EnableHttpCompression = false,
++ DecompressionMethod = CompressionMethod.None
};
foreach (var header in mediaSource.RequiredHttpHeaders)
diff --cc Jellyfin.Server/Program.cs
index 95ce08f269,11c09db983..75b820b8e1
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@@ -116,16 -116,10 +116,21 @@@ namespace Jellyfin.Serve
ApplicationHost.LogEnvironmentInfo(_logger, appPaths);
- SQLitePCL.Batteries_V2.Init();
+ // Increase the max http request limit
+ // The default connection limit is 10 for ASP.NET hosted applications and 2 for all others.
+ ServicePointManager.DefaultConnectionLimit = Math.Max(96, ServicePointManager.DefaultConnectionLimit);
+
++// CA5359: Do Not Disable Certificate Validation
++#pragma warning disable CA5359
+
+ // Increase the max http request limit
+ // The default connection limit is 10 for ASP.NET hosted applications and 2 for all others.
+ ServicePointManager.DefaultConnectionLimit = Math.Max(96, ServicePointManager.DefaultConnectionLimit);
+
+ // Disable the "Expect: 100-Continue" header by default
+ // http://stackoverflow.com/questions/566437/http-post-returns-the-error-417-expectation-failed-c
+ ServicePointManager.Expect100Continue = false;
+
// CA5359: Do Not Disable Certificate Validation
#pragma warning disable CA5359
diff --cc deployment/debian-package-x64/pkg-src/bin/restart.sh
index 9b64b6d728,738f86727c..9b64b6d728
mode 100644,100755..100755
--- a/deployment/debian-package-x64/pkg-src/bin/restart.sh
+++ b/deployment/debian-package-x64/pkg-src/bin/restart.sh
diff --cc deployment/fedora-package-x64/pkg-src/restart.sh
index 9b64b6d728,e84dca587f..9b64b6d728
mode 100644,100755..100755
--- a/deployment/fedora-package-x64/pkg-src/restart.sh
+++ b/deployment/fedora-package-x64/pkg-src/restart.sh