mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 09:44:47 +03:00
update seasons
This commit is contained in:
@@ -238,6 +238,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
_connection.AddColumn(Logger, "TypedBaseItems", "PrimaryVersionId", "Text");
|
||||
_connection.AddColumn(Logger, "TypedBaseItems", "DateLastMediaAdded", "DATETIME");
|
||||
_connection.AddColumn(Logger, "TypedBaseItems", "Album", "Text");
|
||||
_connection.AddColumn(Logger, "TypedBaseItems", "IsVirtualItem", "BIT");
|
||||
|
||||
_connection.AddColumn(Logger, "UserDataKeys", "Priority", "INT");
|
||||
|
||||
@@ -359,7 +360,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
"DateLastMediaAdded",
|
||||
"Album",
|
||||
"CriticRating",
|
||||
"CriticRatingSummary"
|
||||
"CriticRatingSummary",
|
||||
"IsVirtualItem"
|
||||
};
|
||||
|
||||
private readonly string[] _mediaStreamSaveColumns =
|
||||
@@ -474,7 +476,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
"OriginalTitle",
|
||||
"PrimaryVersionId",
|
||||
"DateLastMediaAdded",
|
||||
"Album"
|
||||
"Album",
|
||||
"IsVirtualItem"
|
||||
};
|
||||
_saveItemCommand = _connection.CreateCommand();
|
||||
_saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (";
|
||||
@@ -866,6 +869,16 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
|
||||
_saveItemCommand.GetParameter(index++).Value = item.Album;
|
||||
|
||||
var season = item as Season;
|
||||
if (season != null && season.IsVirtualItem.HasValue)
|
||||
{
|
||||
_saveItemCommand.GetParameter(index++).Value = season.IsVirtualItem.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
_saveItemCommand.GetParameter(index++).Value = null;
|
||||
}
|
||||
|
||||
_saveItemCommand.Transaction = transaction;
|
||||
|
||||
_saveItemCommand.ExecuteNonQuery();
|
||||
@@ -1281,6 +1294,12 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
item.CriticRatingSummary = reader.GetString(57);
|
||||
}
|
||||
|
||||
var season = item as Season;
|
||||
if (season != null && !reader.IsDBNull(58))
|
||||
{
|
||||
season.IsVirtualItem = reader.GetBoolean(58);
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user