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

@@ -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;