save series name separately

This commit is contained in:
Luke Pulverenti 2016-05-23 00:11:37 -04:00
parent e9b0b3d2ae
commit bc2f18bce3
2 changed files with 14 additions and 3 deletions

View File

@ -223,7 +223,6 @@ namespace MediaBrowser.Model.Configuration
DenyIFrameEmbedding = true;
EnableUPnP = true;
SchemaVersion = 79;
SharingExpirationDays = 30;
MinResumePct = 5;
MaxResumePct = 90;

View File

@ -87,7 +87,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
private IDbCommand _updateInheritedRatingCommand;
private IDbCommand _updateInheritedTagsCommand;
public const int LatestSchemaVersion = 79;
public const int LatestSchemaVersion = 80;
/// <summary>
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
@ -239,6 +239,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
_connection.AddColumn(Logger, "TypedBaseItems", "DateLastMediaAdded", "DATETIME");
_connection.AddColumn(Logger, "TypedBaseItems", "Album", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "IsVirtualItem", "BIT");
_connection.AddColumn(Logger, "TypedBaseItems", "SeriesName", "Text");
_connection.AddColumn(Logger, "UserDataKeys", "Priority", "INT");
@ -433,7 +434,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
"PrimaryVersionId",
"DateLastMediaAdded",
"Album",
"IsVirtualItem"
"IsVirtualItem",
"SeriesName"
};
_saveItemCommand = _connection.CreateCommand();
_saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (";
@ -835,6 +837,16 @@ namespace MediaBrowser.Server.Implementations.Persistence
_saveItemCommand.GetParameter(index++).Value = null;
}
var hasSeries = item as IHasSeries;
if (hasSeries != null)
{
_saveItemCommand.GetParameter(index++).Value = hasSeries.SeriesName;
}
else
{
_saveItemCommand.GetParameter(index++).Value = null;
}
_saveItemCommand.Transaction = transaction;
_saveItemCommand.ExecuteNonQuery();