update .net core startup

This commit is contained in:
Luke Pulverenti
2016-11-13 16:04:21 -05:00
parent 3c55747cd6
commit 0e9cd51f9c
38 changed files with 355 additions and 325 deletions

View File

@@ -725,6 +725,11 @@ namespace Emby.Server.Core
try
{
if (!FileSystemManager.FileExists(certificateLocation))
{
return null;
}
X509Certificate2 localCert = new X509Certificate2(certificateLocation);
//localCert.PrivateKey = PrivateKey.CreateFromFile(pvk_file).RSA;
if (!localCert.HasPrivateKey)
@@ -1438,12 +1443,7 @@ namespace Emby.Server.Core
try
{
AuthorizeServer(
UdpServerEntryPoint.PortNumber,
ServerConfigurationManager.Configuration.HttpServerPortNumber,
ServerConfigurationManager.Configuration.HttpsPortNumber,
ConfigurationManager.CommonApplicationPaths.ApplicationPath,
ConfigurationManager.CommonApplicationPaths.TempDirectory);
AuthorizeServer();
}
catch (Exception ex)
{
@@ -1451,7 +1451,7 @@ namespace Emby.Server.Core
}
}
protected abstract void AuthorizeServer(int udpPort, int httpServerPort, int httpsServerPort, string applicationPath, string tempDirectory);
protected abstract void AuthorizeServer();
protected abstract IDbConnector GetDbConnector();
public event EventHandler HasUpdateAvailableChanged;

View File

@@ -40,7 +40,7 @@ namespace Emby.Server.Core.Data
public static IDataParameter Add(this IDataParameterCollection paramCollection, IDbCommand cmd, string name)
{
var param = cmd.CreateParameter();
param.ParameterName = name;
paramCollection.Add(param);
@@ -173,7 +173,7 @@ namespace Emby.Server.Core.Data
var builder = new StringBuilder();
builder.AppendLine("alter table " + table);
builder.AppendLine("add column " + columnName + " " + type);
builder.AppendLine("add column " + columnName + " " + type + " NULL");
connection.RunQueries(new[] { builder.ToString() }, logger);
}

View File

@@ -157,7 +157,7 @@ namespace Emby.Server.Core.Data
string[] queries = {
"create table if not exists TypedBaseItems (guid GUID primary key, type TEXT, data BLOB, ParentId GUID, Path TEXT)",
"create table if not exists TypedBaseItems (guid GUID primary key NOT NULL, type TEXT NOT NULL, data BLOB NULL, ParentId GUID NULL, Path TEXT NULL)",
"create table if not exists AncestorIds (ItemId GUID, AncestorId GUID, AncestorIdText TEXT, PRIMARY KEY (ItemId, AncestorId))",
"create index if not exists idx_AncestorIds1 on AncestorIds(AncestorId)",
@@ -286,6 +286,7 @@ namespace Emby.Server.Core.Data
_connection.AddColumn(Logger, "TypedBaseItems", "ExtraType", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "Artists", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "AlbumArtists", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "ExternalId", "Text");
_connection.AddColumn(Logger, "ItemValues", "CleanValue", "Text");
@@ -440,7 +441,8 @@ namespace Emby.Server.Core.Data
"TotalBitrate",
"ExtraType",
"Artists",
"AlbumArtists"
"AlbumArtists",
"ExternalId"
};
private readonly string[] _mediaStreamSaveColumns =
@@ -575,7 +577,8 @@ namespace Emby.Server.Core.Data
"TotalBitrate",
"ExtraType",
"Artists",
"AlbumArtists"
"AlbumArtists",
"ExternalId"
};
_saveItemCommand = _connection.CreateCommand();
_saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (";
@@ -1084,6 +1087,10 @@ namespace Emby.Server.Core.Data
}
}
_saveItemCommand.GetParameter(index++).Value = item.ExternalId;
//Logger.Debug(_saveItemCommand.CommandText);
_saveItemCommand.Transaction = transaction;
_saveItemCommand.ExecuteNonQuery();
@@ -1967,6 +1974,12 @@ namespace Emby.Server.Core.Data
}
index++;
if (!reader.IsDBNull(index))
{
item.ExternalId = reader.GetString(index);
}
index++;
if (string.IsNullOrWhiteSpace(item.Tagline))
{
var movie = item as Movie;

View File

@@ -30,7 +30,7 @@ namespace Emby.Server.Core.Notifications
{
string[] queries = {
"create table if not exists Notifications (Id GUID NOT NULL, UserId GUID NOT NULL, Date DATETIME NOT NULL, Name TEXT NOT NULL, Description TEXT, Url TEXT, Level TEXT NOT NULL, IsRead BOOLEAN NOT NULL, Category TEXT NOT NULL, RelatedId TEXT, PRIMARY KEY (Id, UserId))",
"create table if not exists Notifications (Id GUID NOT NULL, UserId GUID NOT NULL, Date DATETIME NOT NULL, Name TEXT NOT NULL, Description TEXT NULL, Url TEXT NULL, Level TEXT NOT NULL, IsRead BOOLEAN NOT NULL, Category TEXT NOT NULL, RelatedId TEXT NULL, PRIMARY KEY (Id, UserId))",
"create index if not exists idx_Notifications1 on Notifications(Id)",
"create index if not exists idx_Notifications2 on Notifications(UserId)"
};

View File

@@ -12,8 +12,8 @@ namespace Emby.Server.Core
/// <summary>
/// Initializes a new instance of the <see cref="BaseApplicationPaths" /> class.
/// </summary>
public ServerApplicationPaths(string programDataPath, string applicationPath, string applicationResourcesPath)
: base(programDataPath, applicationPath)
public ServerApplicationPaths(string programDataPath, string appFolderPath, string applicationResourcesPath)
: base(programDataPath, appFolderPath)
{
ApplicationResourcesPath = applicationResourcesPath;
}